- 论坛徽章:
- 0
|
request( method, url[, body[, headers]])
This will send a request to the server using the HTTP request method method and the selector url. If the body argument is present, it should be a string of data to send after the headers are finished. The header Content-Length is automatically set to the correct value. The headers argument should be a mapping of extra HTTP headers to send with the request.
putrequest( request, selector[, skip_host[, skip_accept_encoding]])
This should be the first call after the connection to the server has been made. It sends a line to the server consisting of the request string, the selector string, and the HTTP version (HTTP/1.1). To disable automatic sending of Host: or Accept-Encoding: headers (for example to accept additional content encodings), specify skip_host or skip_accept_encoding with non-False values. Changed in version 2.4: skip_accept_encoding argument added.
貌似应该是putrequest不会自动发送header部分,request是自动的,你可以看下官方docs |
|