HTTP status codes / 4xx — Client errors
The server could not parse or accept the request as sent.
The generic client error: malformed JSON, invalid parameters, missing required fields, broken encoding or headers. The response body usually (and should) explain what exactly was wrong.
curl -i -X POST -H "Content-Type: application/json" -d '{broken json' https://httpbin.org/post Same request, no terminal: paste this into the cURL converter for native code, or straight into ReqPad on your phone.
Reproduce the request in an API client and inspect the body the server returns — then validate your JSON syntax, Content-Type header and parameter types one by one.
Server-side note: Return (and read) a body that names the offending field — a bare 400 wastes everyone's day.
The fastest way to pin down a 400 is to reproduce the exact request and inspect what actually went over the wire — status, headers, timing and body, without your app code in the way. That is what an API client is for; ReqPad does it from your phone, with every request saved to history.
401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 405 Method Not Allowed · 406 Not Acceptable — or the full reference.
Build the request, send it, read status + headers + timing — on your iPhone. Free to start.