Skip to content

Commit 5c86e1c

Browse files
committed
docs: README file
1 parent 1b6bcf9 commit 5c86e1c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# typescript-http-client
3+
4+
## Install
5+
6+
```bash
7+
npm i https://github.com/tikiram/typescript-http-client.git
8+
```
9+
10+
```bash
11+
yarn add typescript-http-client@https://github.com/tikiram/typescript-http-client.git
12+
```
13+
14+
## Example
15+
16+
```js
17+
import {
18+
ErrorHandlerMiddleware,
19+
HTTPClient,
20+
HTTPMethod,
21+
LoggerMiddleware,
22+
} from 'typescript-http-client';
23+
24+
async function something() {
25+
const client = new HTTPClient(
26+
'https://pokeapi.co/api/v2',
27+
[new LoggerMiddleware(), new ErrorHandlerMiddleware()]
28+
);
29+
30+
const response = await client.request<Pokemon>(HTTPMethod.Get, '/pokemon/ditto');
31+
32+
console.log(response)
33+
}
34+
35+
```

0 commit comments

Comments
 (0)