HTTP 408 Request Timeout indicates the server waited too long for the client to send the complete request. The server is closing the connection because the client didn't finish transmitting within the allowed time. This is not about server processing time (which would be a 504 from a proxy) — it's about the client being too slow to send its request. Servers send 408 to free up connections from idle or stalled clients.
Response includes the status code, standard headers (including Content-Type), and a small diagnostic JSON body describing the request and returned status.
Simulator URL (copy in the app after load — not a normal link):
https://httpstatus.com/api/status/408
Example request:
curl -i "https://httpstatus.com/api/status/408"The server timed out waiting for the request.
On this code, Inspector focuses on semantics, headers, and correctness warnings that commonly affect clients and caches.
HTTP 408 Request Timeout has specific technical implications for API design, caching, and client behavior. Understanding the precise semantics helps distinguish it from similar status codes and implement correct error handling. The response should include a descriptive body following a consistent error schema (like RFC 7807 Problem Details) so clients can programmatically handle the error.
// Handle 408 Request Timeout in Express
app.use((err, req, res, next) => {
if (err.status === 408) {
return res.status(408).json({
type: 'https://api.example.com/errors/request-timeout',
title: 'Request Timeout',
status: 408,
detail: err.message
});
}
next(err);
});from fastapi import HTTPException
# Raise 408 Request Timeout
raise HTTPException(
status_code=408,
detail={
'type': 'request_timeout',
'message': 'Descriptive error for 408 Request Timeout'
}
)// Spring Boot 408 Request Timeout handling
@ExceptionHandler(CustomRequestTimeoutException.class)
public ResponseEntity<ErrorResponse> handleRequestTimeout(
CustomRequestTimeoutException ex) {
return ResponseEntity.status(408)
.body(new ErrorResponse("Request Timeout", ex.getMessage()));
}// Return 408 Request Timeout
func errorHandler(w http.ResponseWriter, message string) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(408)
json.NewEncoder(w).Encode(map[string]any{
"status": 408,
"error": "Request Timeout",
"message": message,
})
}