Automation · APIs
Request Body
Cheat sheet · https://pcornel.dk/topic.php?topic=5305
Answer
The structured representation or command payload submitted to an API operation.
Remember
- Valid JSON/XML ≠ valid API payload; schema, required fields and semantic constraints remain separate.
- Field omitted ≠ default known; server defaults, null and absent can have different meanings.
- Client object serialized ≠ intended wire contract; serializers can rename, omit or coerce fields.
- Request accepted ≠ every field applied; servers may ignore read-only or unknown properties.
First checks
jq . payload.json— valid JSON bodycheck-jsonschema --schemafile schema.json payload.json— validate before sendingcurl -d @payload.json -H 'Content-Type: application/json' <url>— send
Verify in this order
payload → validation → request body
Where it usually breaks
Payload syntax proves only parseability; it does not prove semantic validity or that every requested field affected state.
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
Request Body API boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind retries, credential rotation, replay or payload edits before evidence is captured |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5305