python模拟cur -d post请求
2019-05-15 本文已影响0人
安静的码农
curl -X POST -d "date=2017-04-13&channel=vod.tv.cn&isExactMatch=false®ion=&startdate=2017-04-13&enddate=2017-04-14" http://opencenter.com/myview/bandwidth-origin
形如这种类型的curl请求,使用python的写法如下:
url = "http://opencenter.com/myview/bandwidth-origin"
data = {'channel': 'vod.tv.cn', 'dataformat': 'json','date':'2017-04-13'}
res = requests.post(url,data=data,timeout=100)
print res.text