Skip to content

Commit 71c7c33

Browse files
chore(docs): improve docs for withResponse/asResponse (#32)
1 parent 4d59d92 commit 71c7c33

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
@@ -133,8 +133,10 @@ Note that requests which time out will be [retried twice by default](#retries).
133133
### Accessing raw Response data (e.g., headers)
134134

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

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

139141
<!-- prettier-ignore -->
140142
```ts

0 commit comments

Comments
 (0)