You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -133,8 +133,10 @@ Note that requests which time out will be [retried twice by default](#retries).
133
133
### Accessing raw Response data (e.g., headers)
134
134
135
135
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.
136
137
137
138
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.
0 commit comments