Skip to content

Commit bcc9f2c

Browse files
committed
Update README.md
1 parent 640b20f commit bcc9f2c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ const client = createClient("baseUrl", {
130130
### Encoder and Decoder
131131
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
132132
encoding where we ignore the `encoder`, these cases are when the type of the body is supported by native fetch, which are:
133+
* **String**
133134
* **ReadableStream**
134135
* **FormData**
135136
* **ArrayBuffer**
@@ -138,6 +139,14 @@ encoding where we ignore the `encoder`, these cases are when the type of the bod
138139
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
139140
a different encoder at a global, per-resource and per-route level by specifying the `encoder` and `decoder` properties.
140141

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.
149+
141150
## 🔌 Hooks: Supercharge Your Workflows
142151

143152
Add hooks magic at any level:

0 commit comments

Comments
 (0)