Skip to content

Commit f8b86cb

Browse files
rgarciaclaude
authored andcommitted
docs: show both raw streaming and buffered curl in routing example
Add the buffered client.browsers.curl call alongside the raw streaming client.browsers.request call, with comments noting when to use each. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 78d21fe commit f8b86cb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

examples/browser_routing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ def main() -> None:
99
client = Kernel()
1010

1111
browser = client.browsers.create()
12+
13+
# Raw browser curl: streams the response. Use for large responses or when you want to stream.
1214
response: httpx.Response = client.browsers.request(browser.session_id, "GET", "https://example.com")
1315
print("status", response.status_code)
1416

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

1723

0 commit comments

Comments
 (0)