network_body - kubed-io/selenium-flow GitHub Wiki
Fetch the response body of one request the page made, by its id from
| MCP tool | network_body |
| HTTP | POST /browser/network-body |
workspace://network (an id looks like 3.7). Text comes back up to 100 kB, with truncated=true beyond that; for an image or other binary you get its type and size, not its bytes. The browser keeps bodies only while it lives, so read one soon after the request; it needs open_session(capture=true).
| Name | Type | Required | Default |
|---|---|---|---|
id |
string | yes | — |
Every call names its workspace: an X-Workspace header, or
?workspace=<name>. Sending both is refused. See Workspaces.
| Field | Type | Notes |
|---|---|---|
id |
string | The request id that was asked for. |
uri |
string | workspace://network/{id}, which shows the request itself. |
mime |
string | The response's content type. |
size |
integer | Bytes of a text body as the browser handed it back, before any cut. A binary body is never fetched, so its size is the request row's; null when that is unknown. |
binary |
boolean | True for a body that is not text: it is not fetched, and only its type and size come back. |
text |
string | The text, up to 100 000 bytes; null for a binary body. |
truncated |
boolean | True when the text was cut at 100 000 bytes. |
page |
object | Present only when this browser was opened with capture=true and the page reported a failure while the call ran: what it caused, and where to read it. |
| Status | Means |
|---|---|
400 |
The request cannot succeed as sent — a missing field, a value that was rejected, or a locator that matched nothing before the wait ran out. Do not retry it unchanged. |
401 |
Missing or wrong bearer token. |
404 |
No such body. No session is open in this workspace, or the browser that made this request has ended or no longer holds its body: a body lives only as long as its browser. A new browser cannot return it, so do not retry; and opening one without capture forgets what was captured. |
413 |
The body is over its cap: 1 MiB of JSON, 64 MiB of upload, 1 MiB of flow YAML. Send less; retrying it unchanged will fail again. |
500 |
Something failed that this server did not expect. |
503 |
The Grid could not serve this — unreachable, or no free slot for a new browser. Worth retrying after a wait. |
Over MCP the same failures arrive as a tool error.
MCP
network_body(id="…")
HTTP
curl -X POST $SELENIUM_FLOW/browser/network-body \
-H "Authorization: Bearer $TOKEN" \
-H "X-Workspace: $WORKSPACE" \
-H 'Content-Type: application/json' \
-d '{
"id": "…"
}'Ids come from workspace://network and look like 3.7: the navigation, then
the request.
The body lives in the browser, not in this server. It is gone when the browser ends (the call answers 404) and once the browser drops it, past about 200 MB.
A text body comes back up to 100 kB; a binary one as its type and size.
open_session(capture=true) must have been used; capture is not inherited by
an open_session() without it. The admin UI's Fetch body is the same read.