python post请求demo2
#!/usr/bin/python# coding=utf-8import urllib2values ={}data='''info={"username":"xxxx@foxmail.com","password":"x3d8d1200d278df5664761922ff2cEHBQ","code":"","autologin":false}'''# data = urllib.urlenc
·
#!/usr/bin/python
# coding=utf-8
import urllib2
values ={}
data='''info={"username":"xxxx@foxmail.com","password":"x3d8d1200d278df5664761922ff2cEHBQ","code":"","autologin":false}'''
# data = urllib.urlencode(data)
req = urllib2.Request("https://www.oshadan.com/validateLogin",data)
req.add_header('Host','www.oshadan.com')
req.add_header('User-Agent','Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0')
req.add_header('Accept','application/json, text/javascript, */*; q=0.01')
req.add_header('Accept-Language','zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3')
req.add_header('Accept-Encoding','gzip, deflate, br')
req.add_header('Content-Type','application/x-www-form-urlencoded; charset=UTF-8')
req.add_header('X-Requested-With','XMLHttpRequest')
req.add_header('Referer','https://www.oshadan.com/login')
req.add_header('Content-Length','115')
resp = urllib2.urlopen(req)
print resp.read()
更多推荐
已为社区贡献7条内容
所有评论(0)