HTTPError.net

The fastest way to diagnose, understand, and fix any HTTP status code

307 Temporary Redirect

Fault: Neither
TL;DR

Temporary redirect that preserves the request method.

The request should be repeated with another URL, but future requests should still use the original URL.

What HTTP 307 Temporary Redirect Means

The request should be repeated with another URL, but future requests should still use the original URL.

Temporary redirect that preserves the request method.

Common Causes

How to Fix It (For Visitors)

How to Fix It (For Developers/Admins)

Returning a 307 Temporary Redirect (Code Examples)

If you build APIs or web apps, here is how to send an HTTP 307 response and how to test for it:

Node.js (Express)

app.get('/resource', (req, res) => {
  res.status(307).json({ error: 'Temporary Redirect' });
});

Python (Flask)

@app.route('/resource')
def resource():
    return jsonify(error='Temporary Redirect'), 307

PHP

<?php
http_response_code(307);
header('Content-Type: application/json');
echo json_encode(['error' => 'Temporary Redirect']);

Check the status with curl

curl -I https://example.com/resource
# Look for: HTTP/1.1 307 Temporary Redirect

Frequently Asked Questions

What does HTTP 307 Temporary Redirect mean?

Temporary redirect that preserves the request method. In short: The request should be repeated with another URL, but future requests should still use the original URL.

How should I handle an HTTP 307 Temporary Redirect response?

Use instead of 302 to preserve HTTP method. Set Location header.

Official Specification

The 307 Temporary Redirect status code is defined in RFC 7231 Section 6.4.7.

View the IANA HTTP Status Code Registry →