From c5f9810fd04b6f34b71f3b40d3af1fd9b38a961d Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 16 Aug 2023 16:22:23 +0200 Subject: [PATCH] small updates --- README.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e32a1c7..c25e562 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', {