Package shttp :: Module sHTTP :: Class HTTPBase
[hide private]
[frames] | no frames]

Class HTTPBase

source code

Known Subclasses:
HTTP, HTTPClient

Common code to HTTP client and HTTP server

Instance Methods [hide private]
 
close(self)
close the Object
source code
 
close_socket(self) source code
 
__del__(self) source code
 
set_socket(self, commsocket, usingssl=True)
Change the socket that connecs peers
source code
 
__init__(self, commsocket, usingssl=True)
Initialize the HTTPBase instance.
source code
 
__getitem__(self, v)
Get the |v| HTTP header
source code
 
_read(self) source code
 
get_content(self, just_file_pointer=True, get_raw_data=True)
Return the content of the document (a POST in the server, a response int the client)
source code
 
request_error(self, string)
Called when an HTTP Request error ocurrs, in the server is called when a response error is present.
source code
 
header_error(self, string)
Called when a bad header is present
source code
 
_readline(self, max=512) source code
 
read_headers(self)
Read the headers and the (response status|request)
source code
 
_write(self, data) source code
 
put_headers(self, headers=None)
Send the headers, including the response|request
source code
 
get_method(self)
What method is used to communicate (i.e.
source code
 
get_uri(self)
The URI or requested location
source code
 
get_httpversion(self)
The version of the HTTP used
source code
Method Details [hide private]

__init__(self, commsocket, usingssl=True)
(Constructor)

source code 

Initialize the HTTPBase instance. |commsocket| is the socket that connects peers.

NOTE:

Every specialized sub-class must be careful with flushes over self.fp and its file objects. The flushes have an important impact in performance of applications.

request_error(self, string)

source code 
Called when an HTTP Request error ocurrs, in the server is called when a response error is present. Raises the respective exception in both modes

get_method(self)

source code 
What method is used to communicate (i.e. GET, POST, etc)