Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 16, 2023
1 parent 3f87e7a commit c5f9810
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,17 @@ await ofetch('/url', { ignoreResponseError: true })

`ofetch` Automatically retries the request if an error happens and if response status code is included in `retryStatusCodes` list:

```js
const retryStatusCodes = new Set([
408, // Request Timeout
409, // Conflict
425, // Too Early
429, // Too Many Requests
500, // Internal Server Error
502, // Bad Gateway
503, // Service Unavailable
504 // Gateway Timeout
])
```

- `408` - Request Timeout
- `409` - Conflict
- `425` - Too Early
- `429` - Too Many Requests
- `500` - Internal Server Error
- `502` - Bad Gateway
- `503` - Service Unavailable
- `504` - Gateway Timeout

Default is `1` (except for `POST`, `PUT`, `PATCH` and `DELETE` methods that is `0`)
Default is `1` retry, except for `POST`, `PUT`, `PATCH` and `DELETE` methods ofetch does not retry.

```ts
await ofetch('http://google.com/404', {
Expand Down

0 comments on commit c5f9810

Please sign in to comment.