在我的代码中,我有以下内容:
parse
运行我在Fiddler中看到的代码时,标题Content-Type和Connection与我上面指定的不一样;相反,它们如下:
http_headers = [
("Content-Type", "text/xml; charset=UTF-8"),
("Connection", "keep-alive"),
("User-Agent", "HttpApp/1.0")
]
opener = build_opener(HTTPCookieProcessor(), ProxyHandler({'http': 'http://127.0.0.1:8888'})) # Fiddler port
default_opener.addheaders = http_headers
response = opener.open(fullurl="<URL>", data=data)