Skip to content

Commit 5b02b6d

Browse files
kaizeennroot
andauthored
docs: add responseType quick reference table to REST guide
Co-authored-by: root <root@yume123.com>
1 parent b7b2236 commit 5b02b6d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docs/guides/rest-requests.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ await client.get("/movies", {
5252
| `responseType` | Override response parsing with `json`, `text`, `arrayBuffer`, or `blob`. Defaults to `auto`. |
5353
| `errorResponseType` | Override non-2xx body parsing. Defaults to `auto`. |
5454

55+
### `responseType` quick reference
56+
57+
| `responseType` | Returns | Common use case |
58+
| --- | --- | --- |
59+
| `auto` (default) | Auto-detected value from `content-type` (`json`, `text`, or binary fallback) | Most API calls where response format is standard and predictable. |
60+
| `json` | Parsed JSON value | REST/GraphQL responses that always return structured JSON. |
61+
| `text` | UTF-8 string | Plain text endpoints, HTML fragments, or server messages. |
62+
| `arrayBuffer` | `ArrayBuffer` | File downloads, protobuf payloads, or any binary processing pipeline. |
63+
| `blob` | `Blob` (when available) | Browser-first file handling, previews, and upload/download flows. |
64+
5565
`headers` and `defaultHeaders` accept any `HeadersInit` shape: plain objects,
5666
native `Headers`, or `[name, value]` tuples. Header names are normalized
5767
case-insensitively before the request reaches plugins or transports.

0 commit comments

Comments
 (0)