折腾:
[未解决]Flask中login_required和redirect之后如何保持之前的POST而不是GET
期间,用到:
return redirect(url_for(“wechat_auth”, nextRedirectUrl=nextRedirectUrl), code=307) |
搜:
HTTP code 307
“307 Temporary Redirect
请求的资源现在临时从不同的URI响应请求。由于这样的重定向是临时的,客户端应当继续向原有地址发送以后的请求。只有在Cache-Control或Expires中进行了指定的情况下,这个响应才是可缓存的。
新的临时性的URI应当在响应的Location域中返回。除非这是一个HEAD请求,否则响应的实体中应当包含指向新的URI的超链接及简短说明。因为部分浏览器不能识别307响应,因此需要添加上述必要信息以便用户能够理解并向新的URI发出访问请求。
如果这不是一个GET或者HEAD请求,那么浏览器禁止自动进行重定向,除非得到用户的确认,因为请求的条件可能因此发生变化。”
List of HTTP status codes – Wikipedia, the free encyclopedia
“307 Temporary Redirect (since HTTP/1.1)
In this case, the request should be repeated with another URI; however, future requests should still use the original URI. In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request. For example, a POST request should be repeated using another POST request.[29]”
307 Temporary Redirect — httpstatuses.com
“307 TEMPORARY REDIRECT
The target resource resides temporarily under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI.”
转载请注明:在路上 » 【整理】HTTP的307