diff --git a/README.md b/README.md index e32a1c7d..c25e562f 100644 --- a/README.md +++ b/README.md @@ -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', {