ApiSimul logo ApiSimul — the switchboard

HTTP 431 — Request Header Fields Too Large

HTTP 431 blames the headers: collectively they exceed the server’s field-size budget. Cookie accumulation is the classic culprit — session cookies that grow session after session until every request fails.

When 431 shows up

Mocking a 431 response

A response with this status can be faked end to end with a local mock rule — no backend changes needed. The configuration below mirrors the rule fields the ApiSimul editor uses (method, path, status, delay in milliseconds, response body):

{
  "method": "GET",
  "path": "/api/page",
  "status": 431,
  "delay": 160,
  "enabled": true,
  "body": null
}

Dynamic placeholders such as {{random.name}}, {{string.uuid}} or {{number.int 1 100}} can appear inside the body to vary each response, which keeps client-side list rendering and retry logic honest during development.

Frequently asked questions

What does HTTP 431 mean?
The request headers are too large to process. Clearing cookies or trimming header payloads resolves it; the fix lives on the client side.

How can I test a 431 response without a real backend?
Define a mock rule with the method and path your client requests and set the status to 431. The example configuration above returns this response after the listed delay, so the client exercises its 431 handling exactly as it would against a live server.

Related status codes

Need the response in your own project? Spin up rules for any status with the ApiSimul mock server, or browse every status code page.