【发布时间】:2013-03-30 00:12:06
【问题描述】:
在Python 3.3/Lib/urllib/request.py 下,AbstractHTTPHandler(BaseHandler) 类中,第 1252
h.request(req.get_method(), req.selector, req.data, headers)
在HTTPConnection 类中的Python 3.3/Lib/http/client.py 下,在以下几行中:
第 1047 行
def request(self, method, url, body=None, headers={}):
第 1068 行
def _send_request(self, method, url, body, headers):
第 1087 行
self.endheaders(正文)
在urllib.request.urlopen(req, data)在http.client.HTTPConnection中调用request(method, url, body=None, headers={})时,body和req.data会对应相同的字符串或其他数据。
这是否意味着以下两个相同? (他们在文档中似乎不一样)
HTTPConnection.endheaders(data)-
HTTPConnection.endheaders(),HTTPConnection.send(data)
我完全糊涂了。
【问题讨论】:
标签: python send httpconnection