这种场景是怎样的?
https://www.rfc-editor.org/rfc/rfc9110#status.302
上面是规范内容,估计你使用的是302响应状态码。里面写了这一句
Note: For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request. If this behavior is undesired, the 307 (Temporary Redirect) status code can be used instead.
15 回答8.2k 阅读
7 回答5.2k 阅读
6 回答6.8k 阅读✓ 已解决
8 回答6.1k 阅读
4 回答4.3k 阅读✓ 已解决
5 回答2.8k 阅读
4 回答3.9k 阅读
大多数情况下使用的 301/302 重定向,在重定向的时候,都会变为 GET 请求,如果想要保持之前的请求方式,可以改为 307 重定向。
使用 HTTP 强制跳转 HTTPS 不是一个好的做法,好的做法是使用 HSTS,来引导浏览器使用 HTTPS 访问。因为你一开始的 HTTP 请求就不是安全的。