Skip to content

Commit 38f5ae5

Browse files
rgarciaclaude
authored andcommitted
docs: print buffered body and mention httpx.Response semantics
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent f8b86cb commit 38f5ae5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

examples/browser_routing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ def main() -> None:
1010

1111
browser = client.browsers.create()
1212

13-
# Raw browser curl: streams the response. Use for large responses or when you want to stream.
13+
# Raw browser curl: streams the response. Use for large responses, when you want to stream,
14+
# or when you want httpx.Response semantics.
1415
response: httpx.Response = client.browsers.request(browser.session_id, "GET", "https://example.com")
1516
print("status", response.status_code)
1617

1718
# Buffered browser curl: returns the full response in a JSON envelope. Use for small responses.
1819
buffered = client.browsers.curl(browser.session_id, url="https://example.com", method="GET")
19-
print("buffered-status", buffered.status)
20+
print("body", buffered.body)
2021

2122
client.browsers.delete_by_id(browser.session_id)
2223

0 commit comments

Comments
 (0)