#有headers的get请求 r = requests.get(url,params=params,headers=headers)

#有headers的get请求  r = requests.get(url,params=params,headers=headers)
import requests
url = "https://httpbin.org/get"

params = {"show_raw":1}
headers = {'User-Agent': 'python-requests/2.18.4'}

r = requests.get(url,params=params,headers=headers)
print(r.status_code)
print(r.json())
print(r.json()["headers"])
posted @ 2018-12-24 23:32  测试小白学习之路  阅读(8202)  评论(0编辑  收藏  举报