在Python 3.3/Lib/urllib/request.py课堂下AbstractHTTPHandler(BaseHandler),第1252行
h.request(req.get_method(), req.selector, req.data, headers)
在Python 3.3/Lib/http/client.pyin class下HTTPConnection,在以下几行中:
第 1047 行
def request(self, method, url, body=None, headers={}):
1068行
def _send_request(self, method, url, body, headers):
1087 号线
self.endheaders(正文)
上面的 body 和 req.data 将对应相同的字符串或其他数据,当urllib.request.urlopen(req, data)调用request(method, url, body=None, headers={}).http.client.HTTPConnection
这是否意味着以下两个相同?(他们在文档中似乎不一样)
HTTPConnection.endheaders(data)HTTPConnection.endheaders(),HTTPConnection.send(data)
我完全糊涂了。