Skip to content

Commit e999123

Browse files
stainless-ci-botRobertCraigie
authored andcommitted
chore(docs): improve docs for withResponse/asResponse
1 parent ad2e92b commit e999123

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
@@ -367,8 +367,10 @@ const message = await client.messages.create(
367367
### Accessing raw Response data (e.g., headers)
368368

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

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

373375
<!-- prettier-ignore -->
374376
```ts

0 commit comments

Comments
 (0)