Skip to content
TraceItX Docs
Documentation

Network bodies

The actual payloads, when you need them. Off by default, on both sides of the gate.

Updated

A network breadcrumb tells you a request returned 500. A body tells you what it returned. That is worth a lot in triage, and it is the most sensitive thing the SDK can capture — which is why it is off by default and gated twice.

Enabling

Server first, in the dashboard. The SDK reads it from GET /api/config. Then the client has to agree:

TraceItXConfig(appId: "txx_live_…", capture: CaptureConfig(network: true))

Bodies are captured only when all of these hold: the server block says on, capture.network is true, capture.networkBodies is not false, the session was sampled in, and the request ran on a session built with networkCaptureConfiguration().

A client can always turn this off and can never turn it on. If you have a contractual reason bodies must not be captured in a particular build, set CaptureConfig(networkBodies: false) and it is off regardless of server state.

The allowlist

bodyContentTypes is an allowlist, not a blocklist. A body whose content type is not listed is never read — not read then discarded, not truncated. That is what keeps image uploads and binary streams out of reports entirely, rather than relying on a size check to catch them.

What arrives

{
  "ref": 17,
  "t": 1765800000123,
  "reqBody": "{\"couponCode\":\"SUMMER25\"}",
  "resBody": "{\"error\":\"cart_empty\"}",
  "resBodyTruncated": false,
  "reqBodyBytes": 26,
  "resBodyBytes": 24
}

ref joins to the network breadcrumb’s data.reqId. Bodies live in payload.networkBodies, deliberately not inline on the crumb — a receiver that only wants the timeline never has to parse them.

Why a body is missing

reqBodySkipped / resBodySkippedMeaning
content-typeNot on the allowlist.
unsupportedThe body could not be read.
errorReading it failed.

A missing body with no skip reason means the request genuinely had none, while content-type means there was one and policy declined it.

iOS specifics

A request body supplied as a stream rather than in memory — httpBodyStream, which is how file and stream uploads arrive — reports unsupported rather than being read into memory. A request that never produced a response (a network failure before headers arrived) has no body entry at all.

Bodies are redacted before they enter the buffer, and a body whose request has no matching network breadcrumb is dropped at encode time — a body is meaningless without the request it belongs to.

Byte caps and the total budget are in Server config.