# 307 Temporary Redirect

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

**Family:** 3xx Redirection

## Rationale

Temporary redirect that preserves the original request method and body.

## In Plain Terms

Go to this other address for now, and send the exact same kind of request there.

## Description

The HTTP 307 Temporary Redirect status code indicates that the target resource is temporarily available at a different URI and the user agent must not change the request method when following the redirect automatically. This makes 307 the safer temporary redirect when POST, PUT, PATCH, or other non-GET methods are involved.

## Server Perspective

### Usage
- Return 307 for temporary API or infrastructure moves that cannot tolerate method rewriting
- Choose 307 over 302 when non-GET behavior must remain exact
- Temporary redirects where the original method and body must be preserved
- Temporary API endpoint moves for POST, PUT, PATCH, or DELETE
- Operational rerouting such as maintenance or traffic shifting without changing request semantics

### Implementation
- Include a Location header with the temporary URI
- Make sure the target endpoint can safely handle the same method and request body

### Common Headers
- Location
- Cache-Control

### Body
- A body is optional, but the redirect target and temporary nature should be clear

### Pitfalls
- Do not use 307 if you actually want the redirected request to switch to GET
- Do not mark a long-term move as temporary if clients should update their stored URIs
- Permanent redirects; use 308
- Cases where the next request should intentionally become GET; use 303
- Simple temporary browser redirects where method preservation is irrelevant and 302 is acceptable

## Client Perspective

### Pitfalls
- Do not handle 307 like 302 if the method and body matter

## Examples

### Temporary API endpoint move

The client should repeat the same POST against the temporary target URI.

**Request:**
```
POST https://api.example.test/api/v1/users
```

**Response:**
```
307 Temporary Redirect
Location: https://api.example.test/api/v2/users
```

### Temporary upload reroute

The request semantics stay intact while the server temporarily shifts traffic.

**Request:**
```
PUT https://api.example.test/uploads/123
```

**Response:**
```
307 Temporary Redirect
Location: https://api.example.test/edge-2/uploads/123
```

## Related Codes

- [302 Found](/docs/302.md)
- [303 See Other](/docs/303.md)
- [308 Permanent Redirect](/docs/308.md)

