HTTP 307 Temporary Redirect is similar to 302 Found but explicitly requires that the request method and body must not change when following the redirect. If a POST was sent, the redirect must also be a POST. This is used when method preservation is important.
When HSTS is active, browsers internally redirect HTTP requests to HTTPS using 307, preserving the original request method.
A load balancer temporarily sends traffic to a different backend while preserving the request method and body.
If the redirect is permanent, use 308 instead of 307.
Confirm the client follows the redirect using the same HTTP method.
curl -v -X POST -d 'data=value' -L https://example.com/api
If you see 307 redirects from HTTP to HTTPS, verify your HSTS headers are configured correctly.