# 408 Request Timeout

> https://http-status.org/docs/408

**Family:** 4xx Client Error

## Rationale

Server timed out waiting for the client's request.

## In Plain Terms

You took too long to send your request. The server got tired of waiting and gave up.

## Description

The HTTP 408 Request Timeout status code indicates that the server did not receive a complete request message within the time that it was prepared to wait.

## Server Perspective

### Usage
- Return 408 for idle or stalled client connections where the request never completed in time
- Use it to close connections the server no longer wants to keep open
- Client sends request headers but body too slowly
- Long delays between request parts
- Client connection appears stalled
- Slow file uploads that timeout

### Implementation
- Include Connection: close when closing the connection
- Tune timeout behavior so normal clients are not punished by overly aggressive limits

### Common Headers
- Connection

### Body
- A body is optional; keep it short because the server is usually closing an idle or incomplete request.

### Pitfalls
- Do not use 408 for slow upstream servers; that is a different problem from 504
- Do not confuse client send-timeouts with application processing failures
- Server processing timeout (use 500 Internal Server Error)
- Gateway/proxy timeout (use 504 Gateway Timeout)
- Rate limiting (use 429 Too Many Requests)

## Client Perspective

### Pitfalls
- Do not treat 408 like a server-side processing timeout

## Examples

### Slow file upload

Client took too long to send file data, server timed out

**Request:**
```
POST https://api.example.test/upload

<streaming upload body>
```

**Response:**
```
408 Request Timeout
Content-Type: application/json
Connection: close

{
  "error": "request_timeout"
}
```

## Related Codes

- [504 Gateway Timeout](/docs/504.md)

