python3发送request请求基本实现
时间:2019-08-30 21:11:10
收藏:0
阅读:266
1 airline_url = ‘http://ws.webxml.com.cn/webservices/DomesticAirline.asmx/getDomesticAirlinesTime‘ 2 3 headers = {‘host‘: ‘ws.webxml.com.cn‘, ‘Content-Type‘: ‘application/x-www-form-urlencoded; charset=utf-8‘} 4 5 airline_data = {‘startCity‘: ‘SHA‘, ‘lastCity‘: ‘‘, ‘theDate‘: ‘2019-08-30‘, ‘userID‘: ‘‘} 6 7 response = requests.request(method=‘post‘, url=airline_url, headers=headers, data=airline_data) 8 9 print(response.content.decode(‘utf-8‘))
原文:https://www.cnblogs.com/shenwazaishenwa/p/11436630.html
评论(0)