HTTP 400 Bad Request
HTTP 400 Bad Request means the recipient considers something about the request invalid. It can come from a server that cannot parse the request or from an intermediary that rejects the request before forwarding it.
Start with the message and the path
An invalid request target, a required header with a bad value or invalid JSON can result in 400. Read the error body and any request ID. For a JSON API, validate the payload and confirm the method, path and Content-Type that the endpoint expects.
Locate the rejection
Compare the exact URL and method directly and through your proxy using a benign request. If the proxy returns 400 to CONNECT, start with the tunnel destination and the proxy’s configuration. If the backend issued it, use its validation logs to identify which part of the request needs correction.
Example of an HTTP 400 in an API request
Suppose POST /api/orders returns 400 with a JSON message saying the parser stopped at the end of the body. Check that the client serialized the same data in both runs and declared the expected media type. In a test environment, start with a complete sample from the API documentation and add fields one at a time. If the API can parse the JSON but rejects a value such as an unsupported date, it might use 422 Unprocessable Content for that validation error.
Find the first place the request changes
Record the method, public hostname, path, time and any request ID, then compare them with your gateway and application logs. An HTTP 400 in the gateway log with no corresponding application entry points to a rejection before the backend. If both logs contain the same request, follow the backend’s error message first. On an HTTP proxy trace, keep the response to CONNECT separate from the response after the tunnel opens. With these details you can tell which team owns the failing hop.