Skip to content

Commit

Permalink
docs: clarify retry behavior (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
picunada committed Aug 16, 2023
1 parent bbdfb9c commit 98cd26f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,20 @@ await ofetch('/url', { ignoreResponseError: true })

## ✔️ Auto Retry

`ofetch` Automatically retries the request if an error happens. Default is `1` (except for `POST`, `PUT`, `PATCH` and `DELETE` methods that is `0`)
`ofetch` Automatically retries the request if an error happens and if response status code is included in `retryStatusCodes` list.

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

**Retry status codes:**

- `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

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

0 comments on commit 98cd26f

Please sign in to comment.