307

Temporary Redirect

3xx Redirection The server sends this response to direct the client to get the requested resource at another URI with same method

Code Examples

Here are examples of how to test HTTP 307 responses in different programming languages:

Select options below to see how to use advanced features in your code:

Request:
curl https://free.mockerapi.com/307
Response Body:
{
  "success": true,
  "status": 307,
  "statusText": "Temporary Redirect - The server sends this response to direct the client to get the requested resource at another URI with same method",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/307",
    "fullUrl": "https://free.mockerapi.com/307"
  }
}
Request:
fetch('https://free.mockerapi.com/307')
  .then(response => {
    console.log('Status:', response.status); // 307
    return response.json();
  })
  .then(data => {
    console.log('Success:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });
Response Body:
{
  "success": true,
  "status": 307,
  "statusText": "Temporary Redirect - The server sends this response to direct the client to get the requested resource at another URI with same method",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/307",
    "fullUrl": "https://free.mockerapi.com/307"
  }
}
Request:
import requests

response = requests.get('https://free.mockerapi.com/307')

print(f'Status Code: {response.status_code}')  # 307
print(f'Response: {response.json()}')
Response Body:
{
  "success": true,
  "status": 307,
  "statusText": "Temporary Redirect - The server sends this response to direct the client to get the requested resource at another URI with same method",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/307",
    "fullUrl": "https://free.mockerapi.com/307"
  }
}
Request:
Response Body:
{
  "success": true,
  "status": 307,
  "statusText": "Temporary Redirect - The server sends this response to direct the client to get the requested resource at another URI with same method",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/307",
    "fullUrl": "https://free.mockerapi.com/307"
  }
}
Request:
require 'net/http'
require 'json'

uri = URI('https://free.mockerapi.com/307')
response = Net::HTTP.get_response(uri)

puts "Status Code: #{response.code}"  # 307
puts "Response: #{JSON.parse(response.body)}"
Response Body:
{
  "success": true,
  "status": 307,
  "statusText": "Temporary Redirect - The server sends this response to direct the client to get the requested resource at another URI with same method",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/307",
    "fullUrl": "https://free.mockerapi.com/307"
  }
}
Request:
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    resp, err := http.Get("https://free.mockerapi.com/307")
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    fmt.Printf("Status Code: %d\n", resp.StatusCode)  // 307

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Printf("Response: %s\n", body)
}
Response Body:
{
  "success": true,
  "status": 307,
  "statusText": "Temporary Redirect - The server sends this response to direct the client to get the requested resource at another URI with same method",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/307",
    "fullUrl": "https://free.mockerapi.com/307"
  }
}
Request:
import java.net.http.*;
import java.net.URI;

public class HttpStatusTest {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://free.mockerapi.com/307"))
            .GET()
            .build();

        HttpResponse response = client.send(request,
            HttpResponse.BodyHandlers.ofString());

        System.out.println("Status Code: " + response.statusCode());  // 307
        System.out.println("Response: " + response.body());
    }
}
Response Body:
{
  "success": true,
  "status": 307,
  "statusText": "Temporary Redirect - The server sends this response to direct the client to get the requested resource at another URI with same method",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/307",
    "fullUrl": "https://free.mockerapi.com/307"
  }
}
Request:
const https = require('https');

https.get('https://free.mockerapi.com/307', (res) => {
  console.log('Status Code:', res.statusCode);  // 307

  let data = '';

  res.on('data', (chunk) => {
    data += chunk;
  });

  res.on('end', () => {
    console.log('Response:', JSON.parse(data));
  });
}).on('error', (err) => {
  console.error('Error:', err.message);
});
Response Body:
{
  "success": true,
  "status": 307,
  "statusText": "Temporary Redirect - The server sends this response to direct the client to get the requested resource at another URI with same method",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/307",
    "fullUrl": "https://free.mockerapi.com/307"
  }
}

What is HTTP 307 Temporary Redirect?

HTTP 307 Temporary Redirect indicates that the request has more than one possible response. The server is informing the client that there are multiple options available for the requested resource, and the user or user agent should choose one of them.

This status code is rarely used in practice. When implemented, the server should include a list of resource characteristics and locations from which the user or user agent can choose the most appropriate one.

When Does This Happen?

A 307 Temporary Redirect response is returned when:

  • A resource is available in multiple formats (e.g., different languages, file formats)
  • Multiple versions of a resource exist and the server wants the client to choose
  • The server cannot determine which representation to return based on the request headers
  • Content negotiation requires explicit user selection

Try It Live

Click the button below to make a live request and see the 307 Temporary Redirect response

Common Use Cases

๐ŸŒ Content Negotiation Testing

Test how your application handles multiple resource options and content negotiation scenarios.

๐Ÿ”„ Multi-Format Resources

Mock responses for resources available in multiple formats (JSON, XML, etc.) or languages.

๐Ÿ“‹ Version Selection

Test client behavior when multiple versions of an API or resource are available.

๐ŸŽฏ Client Choice Testing

Verify that your application properly handles scenarios where user selection is required.

๐Ÿ” API Documentation

Demonstrate multiple choice scenarios in API documentation with working examples.

๐Ÿงช Edge Case Testing

Test rarely-used HTTP status codes to ensure comprehensive error handling.

Related Redirection Status Codes