Skip to content

Commit 25092c5

Browse files
committedMar 5, 2025·
chore(docs): improve docs for withResponse/asResponse (#54)
1 parent 54a7db8 commit 25092c5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎README.md

+2
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ while (page.hasNextPage()) {
171171
### Accessing raw Response data (e.g., headers)
172172

173173
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
174+
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.
174175

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

177179
<!-- prettier-ignore -->
178180
```ts

0 commit comments

Comments
 (0)
Please sign in to comment.