在Python CGI中返回http状态代码 [英] Returning http status codes in Python CGI
本文介绍了在Python CGI中返回http状态代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以通过python cgi脚本发送200以外的状态代码(例如301重定向)
Is it possible to send a status code other than 200 via a python cgi script (such as 301 redirect)
推荐答案
通过cgi脚本?
print "Status:301\nLocation: http://www.google.com"
这篇关于在Python CGI中返回http状态代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文