51Testing软件测试论坛

标题: python get和post请求头 [打印本页]

作者: 黑盒测试    时间: 2016-12-21 10:18
标题: python get和post请求头
python 写get和post请求,我目前都没有配置请求头,但是可以请求成功啊
但是看网上都需要手动配置请求头吗?到底是配置呢 还是不配置呢?
还是有固定的请求头,每次都复制上去就可以了



作者: 黑盒测试    时间: 2016-12-21 11:35
这样的请求头可以吗

headers={'Connection':'keep-alive',
            'Referer':'http://hxtest.51tv.com/include/ajaxdata.jsp?action=login&t=1480922358808',
            'Accept-Language':'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
            'Accept-Encoding':'gzip, deflate',
            'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0',
            'Accept':'*/*',
            'Host':'hxtest.51tv.com'
            }





欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2