307 - Temporary Redirect
HTTP 307 Temporary Redirect means the resource is temporarily elsewhere and request method must be preserved.
Last reviewed: February 20, 2026|Source-backed guidance under our editorial policy
Start Here
Use the closest compare guide, playbook, or adjacent error page to narrow the decision faster before you start changing production systems.
This page is part of the Error Reference library. Learn more about the project or report a correction.
What Does Temporary Redirect Mean?
The target is temporarily relocated, but request semantics must remain identical because method and body are required to be preserved.
Common Causes
- -Edge router temporarily reroutes traffic to regional endpoint and preserves original method and request body.
- -Maintenance failover policy sends write calls to standby cluster using temporary method-preserving redirect.
- -Device flow endpoint performs temporary relocation while requiring POST semantics to remain unchanged.
How to Fix Temporary Redirect
- 1Validate redirect targets and confirm destination endpoints safely accept the same method and request body.
- 2Verify client and SDK redirect handling preserves method and payload when automatically following 307.
- 3Disable auto-follow on sensitive non-idempotent routes until method-preserving behavior is validated.
Step-by-Step Diagnosis for Temporary Redirect
- 1Capture original request plus
Locationand follow-up request details for 307 flows. - 2Verify method/body/header preservation across each redirect-following client implementation.
- 3Inspect proxy/CDN behaviors for method rewrite or payload loss on temporary redirect hops.
- 4Retest non-idempotent flows with idempotency controls to catch replay anomalies.
Method-Preservation Redirect Integrity
- -Validate method and body equivalence pre/post redirect (example: POST body dropped when library auto-follows 307).
- -Check header preservation for auth/content metadata (example: Authorization header stripped on cross-host redirect).
Temporary Routing Safety and Replay Controls
- -Audit temporary route toggles and rollback windows (example: regional failover 307 persists beyond incident).
- -Verify idempotency controls on write methods (example: redirect retry leads to duplicate mutation without idempotency key).
Implementation Examples
curl -i -X POST https://api.example.com/v1/resource -H "Content-Type: application/json" -d "{"sample":true}"
# Response:
# HTTP/1.1 307 Temporary Redirect
# Location: https://api.example.com/v1/resource-temporaryconst response = await fetch('https://api.example.com/v1/resource', {
method: 'POST',
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
body: JSON.stringify({ sample: true }),
redirect: 'manual'
});
if (response.status === 307) {
console.error('Handle 307 Temporary Redirect:', response.headers.get('location'));
}import requests
response = requests.post(
'https://api.example.com/v1/resource',
headers={'Accept': 'application/json', 'Content-Type': 'application/json'},
json={'sample': True},
allow_redirects=False
)
if response.status_code == 307:
print('Handle 307 Temporary Redirect', response.headers.get('Location'))Seen in Production
Temporary regional failover for write endpoint
Frequency: common
Example: Primary region issues 307 to backup region while preserving POST semantics for order submission.
Fix: Validate idempotency and body preservation across failover redirect path before enabling globally.
One mobile SDK rewrites method despite 307 contract
Frequency: rare
Example: Legacy client follows 307 but converts POST to GET, causing data loss and failed workflows.
Fix: Patch SDK redirect logic and pin minimum supported versions for write-path traffic.
Debugging Tools
- -curl -IL to inspect redirect hops and Location headers
- -Browser DevTools Network tab (Preserve log enabled)
- -CDN and reverse-proxy access logs
- -Redirect-chain checks in CI
How to Verify the Fix
- -Confirm redirected requests keep method and body intact and succeed at the temporary target endpoint.
- -Validate no duplicate side effects occur for non-idempotent operations during redirect follow behavior.
- -Monitor redirect and write-operation logs for replay anomalies after rollout of 307 handling fixes.
How to Prevent Recurrence
- -Add contract tests that assert method and payload preservation for all 307 redirect paths.
- -Require idempotency keys for write operations that may cross temporary redirect boundaries.
- -Use temporary redirects for write paths only with documented rollback plans and observability gates.
Pro Tip
- -canary-test redirect behavior per SDK/runtime because 307 handling differences often appear only in specific client libraries.
Official References
Provider Context
This guidance is specific to HTTP services. Always validate implementation details against official provider documentation before deploying to production.