4xx Client Errors

HTTP 408 Request Timeout

The server timed out waiting for the request from the client.

When is 408 used?

  • Slow client connection
  • Network issues causing delayed requests
  • Server load balancing timeout

How to handle a 408 response

Inspect the request — URL, method, headers, credentials, and body. Retrying the same request unchanged will usually fail again; 429 is the exception, where you should wait for the Retry-After period.

Check the status code a URL returns from the command line:

curl -s -o /dev/null -w "%{http_code}\n" https://example.com

How to return 408 from your server

Node.js (Express)

res.status(408).json({ message: 'Request Timeout' });

Python (Flask)

return {"message": "Request Timeout"}, 408

Go (net/http)

w.WriteHeader(408)

Frequently Asked Questions

What does HTTP 408 mean?

408 Request Timeout: The server timed out waiting for the request from the client.

Is 408 an error?

Yes. 408 is in the 4xx Client Errors class. Client errors: the request is malformed, unauthorized, or targets something that does not exist.