Qaynaq LABS · TOOLS

HTTP · 4xx Client Error

408 Request Timeout

Server did not receive a complete request within expected time.

When you see this status

  • Client starts sending request but never completes it
  • Network interruption during request transmission
  • Slow client unable to send data within server timeout
  • Proxy or load balancer drops idle connections

Common causes

  • Unstable network connection
  • Client-side timeout too short
  • Server-side idle timeout too aggressive
  • Large request payload with slow upload
  • Malformed client implementation

How to debug it

  1. Check network stability between client and server
  2. Increase client-side timeout to match server expectations
  3. Review server idle timeout configuration
  4. Log request headers to verify partial transmission
  5. Test with smaller payloads to isolate issue

Return this code in your framework

Express (Node.js)
res.status(408).send('Request Timeout');
FastAPI (Python)
from fastapi import HTTPException
raise HTTPException(status_code=408, detail="Request Timeout")
NestJS
@Get()
getData(@Res() res: Response) {
  res.status(408).send('Request Timeout');
}
Go (net/http)
w.WriteHeader(http.StatusRequestTimeout)
w.Write([]byte("Request Timeout"))

About HTTP 408

HTTP status code 408 Request Timeout is part of the 4xx Client Error family. Server did not receive a complete request within expected time. Understanding it is essential for backend engineers, API designers, and anyone debugging integrations between services.

The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance: what triggers them, how to debug them in production, and exactly how to return them from common frameworks. Each code page is hand-curated and verified.

Frequently asked

Should I retry a 408 response?

Yes, but only if the request was incomplete. Implement exponential backoff to avoid overwhelming the server.

How do I adjust server timeout for 408?

Configure server idle timeout (e.g., nginx client_header_timeout, Apache Timeout). Match client expectations.

Is 408 safe to log?

Yes, but avoid logging full request bodies. Log headers and partial data for debugging.