python模拟cur -d post请求

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

你可能感兴趣的:(python模拟cur -d post请求)