Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nick747 committed Jul 31, 2023
1 parent 7318273 commit cb7b61d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,36 @@ hetch.useResponseInterceptor(async (responseData, response) => {
});
```

## Example of Use
Here's an example of use for the Hetch library:
```js
import { Hetch } from "hetch-api";

const customConfig = {
timeout: 5000,
maxRetries: 5,
retryDelay: 2000,
};

const hetch = new Hetch(customConfig);

const url = 'https://jsonplaceholder.typicode.com/todos/1';
const getResponse = await hetch.get(url);
console.log("GET Response Data");
console.log(getResponse.data);
```

Output:
```json
GET Response Data
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
```

## Contributions
Contributions to Hetch-API are welcome! Feel free to create issues or submit pull requests for improvements or bug fixes.

Expand Down

0 comments on commit cb7b61d

Please sign in to comment.