Skip to content

Commit

Permalink
docs: Explain withCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
MattCCC committed Sep 3, 2024
1 parent 91bc522 commit d68c4fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ You can also pass all `fetch()` settings.
| rejectCancelled | boolean | false | If `true` and request is set to `cancellable`, a cancelled requests' promise will be rejected. By default, instead of rejecting the promise, `defaultResponse` is returned. |
| flattenResponse | boolean | false | Flatten nested response data, so you can avoid writing `response.data.data` and obtain response directly. Response is flattened when there is a "data" within response "data", and no other object properties set. |
| defaultResponse | any | null | Default response when there is no data or when endpoint fails depending on the chosen `strategy` |
| withCredentials | boolean | false | Indicates whether credentials (such as cookies) should be included with the request. |
| timeout | int | 30000 | You can set a request timeout for all requests or particular in milliseconds. |
| onRequest | function(config) | | You can specify a function that will be triggered before the request is sent. The request configuration object will be sent as the first argument of the function. This is useful for modifying request parameters, headers, etc. |
| onResponse | function(response) | | You can specify a function that will be triggered when the endpoint successfully responds. The full Response Object is sent as the first argument of the function. This is useful for handling the response data, parsing, and error handling based on status codes. |
Expand Down

0 comments on commit d68c4fd

Please sign in to comment.