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

Class HTTPBase

Known Subclasses:
HTTP, HTTPClient

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

Method Details

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

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.

__getitem__(self, v)
(Indexing operator)

Get the |v| HTTP header

close(self)

close the Object

get_content(self, just_file_pointer=False, get_raw_data=False)

Return the content of the document (a POST in the server, a response int the client)

get_httpversion(self)

The version of the HTTP used

get_method(self)

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

get_uri(self)

The URI or requested location

header_error(self, string)

Called when a bad header is present

put_headers(self, headers=None)

Send the headers, including the response|request

read_headers(self)

Read the headers and the (response status|request)

request_error(self, string)

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

set_socket(self, commsocket, usingssl=False)

Change the socket that connecs peers

Generated by Epydoc 2.1 on Sat Oct 14 11:50:52 2006 http://epydoc.sf.net