import requests
head ={
"Accept": "application/json, text/plain, */*",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en",
"Connection": "keep-alive",
"Cookie": "ecntToken=1c65ecf61c8ee31fb8888a09bf6ae3fb3; SESSIONID=f81e660ef867c476add3bb743f8ac2bc; XSRF-TOKEN=lZw8OuVlVp7O3M0BGHBm6LZe1OyX4DxX13eyYG553cczoSKCioVgLaE87yaj3NIt",
"Host": "192.168.1.1",
"Referer": "http",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
"X-XSRF-TOKEN": "lZw8OuVlVp7O3M0BGHBm6LZe1OyX4DxX13eyYG553cczoSKCioVgLaE87yaj3NIt"
}
url = "http://192.168.1.1/ss-json/fgw.summary.json?bypass=1"
response = requests.get(url = url,headers=head)
print(response.text)
request请求模版
文章描述了如何使用Python的requests库向特定URL(192.168.1.1/ss-json/fgw.summary.json)发送GET请求,带有必要的头信息,然后打印返回的文本内容。
摘要由CSDN通过智能技术生成