开发者

web2py redirect() error HTTP 303 SEE OTHER

开发者 https://www.devze.com 2023-02-22 09:16 出处:网络
ive been implementing and testing the开发者_如何学Python codes in the web2py book and it was all working fine until some redirect function emerged in the codes. i apply the exaclty same codes but i al

ive been implementing and testing the开发者_如何学Python codes in the web2py book and it was all working fine until some redirect function emerged in the codes. i apply the exaclty same codes but i always have HTTP 303 error on redirecting .

help me massimo ! per favore


HTTP/303 isn't an error, it's a Redirect code that tells the client to GET the URL specified in the LOCATION response header.


Hey guys , after some more waiting , i found out the answer. you need to get to http.py in gluon library and change the parameter "how" in the line

"def redirect(location, how=303):"

to "how=307"

i know this is no miracle but wanted to respond still

edit :

well.i just later realised that its all about a faulty import of library

i was importing html and redirect from gluon.http library , and then doing another import from http library. when i removed the "http" import , and leave the "gluon.http" there still , it works , no matter 303 or 307

0

精彩评论

暂无评论...
验证码 换一张
取 消