Module httplib :: Class HTTPConnection
[hide private]
[frames] | no frames]

Class HTTPConnection

Known Subclasses:

Nested Classes [hide private]
  response_class
Instance Methods [hide private]
 
__init__(self, host, port=None, strict=None)
 
_set_hostport(self, host, port)
 
set_debuglevel(self, level)
 
connect(self)
Connect to the host and port specified in __init__.
 
close(self)
Close the connection to the HTTP server.
 
send(self, str)
Send `str' to the server.
 
_output(self, s)
Add a line of output to the current request buffer.
 
_send_output(self)
Send the currently buffered request and clear the buffer.
 
putrequest(self, method, url, skip_host=0, skip_accept_encoding=0)
Send a request to the server.
 
putheader(self, header, value)
Send a request header line to the server.
 
endheaders(self)
Indicate that the last header line has been sent to the server.
 
request(self, method, url, body=None, headers={})
Send a complete request to the server.
 
_send_request(self, method, url, body, headers)
 
getresponse(self)
Get the response from the server.
Class Variables [hide private]
  _http_vsn = 11
  _http_vsn_str = 'HTTP/1.1'
  default_port = 80
  auto_open = 1
  debuglevel = 0
  strict = 0
Method Details [hide private]

_output(self, s)

 

Add a line of output to the current request buffer.

Assumes that the line does *not* end with \r\n.

_send_output(self)

 

Send the currently buffered request and clear the buffer.

Appends an extra \r\n to the buffer.

putrequest(self, method, url, skip_host=0, skip_accept_encoding=0)

 
Send a request to the server.

`method' specifies an HTTP request method, e.g. 'GET'.
`url' specifies the object being requested, e.g. '/index.html'.
`skip_host' if True does not add automatically a 'Host:' header
`skip_accept_encoding' if True does not add automatically an
   'Accept-Encoding:' header

putheader(self, header, value)

 

Send a request header line to the server.

For example: h.putheader('Accept', 'text/html')