#有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"])

转载于:https://www.cnblogs.com/smile2018tao/p/10171670.html

你可能感兴趣的:(json,python,c#)