flask 如何跳转到第三方页面, 要 post 数据.
redirect 而又携带原方法的,我记得是用状态码 307 实现的,不过一般的 web framework 都不这么做(?),你要非得用的话估计得自己制定状态码,这还要看第三方服务支持不支持 307。
而且 redirect 又 post,这是一种什么场景呢?
“The only difference between 307 and 302 is that 307 guarantees that the method and the body will not be changed when the redirected request is made. With 302, some old clients were incorrectly changing the method to GET: the behavior with non-GET methods and 302 is then unpredictable on the Web, whereas the behavior with 307 is predictable. For GET requests, their behavior is identical.”
注意看这里的 302 和 307 的区别
但是如果是 post, 第三方网站只能 post 请求
如何把我的 tokenpost 到 http://xxx.com/login/ 并跳转.实现登录
redirect 其实是通过状态码要求 browser 进行某种重新请求,你修改的 body 是没办法传给 browser 的,这条路估计走不通。