#python socket模拟一个http Get请求页面(请求实验室主机(局域网))
#利用wireshark仿照写出request的请求,http要求比较严格少了一些东西都不能进行成功的访问
import socket
se = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
host=" /jobrecord/login/index.do"
se.connect(("192.168.1.41",91))
try:
se.send("GET /jobrecord/login/index.do HTTP/1.1\r\n")
se.send("Host: 192.168.1.41:91\r\n")
se.send("Connection: keep-alive\r\n")
se.send("Cache-Control: max-age=0\r\n")
se.send("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n")
se.send("Upgrade-Insecure-Requests: 1\r\n")
se.send("User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36\r\n")
se.send("Accept-Encoding: gzip, deflate, sdch\r\n")
se.
python socket模拟一个http Get请求页面
最新推荐文章于 2024-05-17 01:06:25 发布