Skip to content

Commit 0e6d878

Browse files
chore(docs): improve docs for withResponse/asResponse (#91)
1 parent 4652f7b commit 0e6d878

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ Note that requests which time out will be [retried twice by default](#retries).
181181
### Accessing raw Response data (e.g., headers)
182182

183183
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
184+
This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
184185

185186
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
187+
Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
186188

187189
<!-- prettier-ignore -->
188190
```ts

0 commit comments

Comments
 (0)