You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client.ts, by default, uses `JSON.stringify` as the encoder and `JSON.parse` as the decoder, as most of the web standards uses JSON. Although, there are special cases in
132
132
encoding where we ignore the `encoder`, these cases are when the type of the body is supported by native fetch, which are:
133
+
***String**
133
134
***ReadableStream**
134
135
***FormData**
135
136
***ArrayBuffer**
@@ -138,6 +139,14 @@ encoding where we ignore the `encoder`, these cases are when the type of the bod
138
139
If you want to handle those body beforehand, use **Hooks** to transform the request body to your liking before it gets passed to the connector. You can also specify
139
140
a different encoder at a global, per-resource and per-route level by specifying the `encoder` and `decoder` properties.
140
141
142
+
### Fetch
143
+
Client.ts is built on top of the native fetch API, which is supported by all modern browsers. But, we do not support all options that fetch has, although
144
+
we allow you to pass options that we do not support through the `additionalFetchOptions` property in a per-client, per-resource and per-route level, this means
145
+
that you can add options like `credentials`, `mode`, `cache` for browser, or `idempotent`, `blocking`, `reset` for undici fetch.
146
+
147
+
We do it this way because we want to keep the library compatible with most environments, as much as possible. Although, there are definitely scenarios where we cannot
148
+
fulfill this compatibility, but we will try our best to make it as compatible as possible.
0 commit comments