circuits.web.wrappers module¶
Request/Response Wrappers
This module implements the Request and Response objects.
- circuits.web.wrappers.file_generator(input, chunkSize=4096)¶
 
- class circuits.web.wrappers.Host(ip, port, name=None)¶
 Bases:
objectAn internet address.
name should be the client’s host name. If not available (because no DNS lookup is performed), the IP address should be used instead.
- ip = '0.0.0.0'¶
 
- port = 80¶
 
- name = 'unknown.tld'¶
 
- class circuits.web.wrappers.HTTPStatus(status=200, reason=None)¶
 Bases:
object- property status¶
 
- property reason¶
 
- class circuits.web.wrappers.Request(sock, method='GET', scheme='http', path='/', protocol=(1, 1), qs='', headers=None, server=None)¶
 Bases:
objectCreates a new Request object to hold information about a request.
- Parameters:
 sock (socket.socket) – The socket object of the request.
method (str) – The requested method.
scheme (str) – The requested scheme.
path (str) – The requested path.
protocol (str) – The requested protocol.
qs (str) – The query string of the request.
Initializes x; see x.__class__.__doc__ for signature
- index = None¶
 
- script_name = ''¶
 
- login = None¶
 
- handled = False¶
 
- scheme = 'http'¶
 
- protocol = (1, 1)¶
 
- server = None¶
 - Cvar:
 A reference to the underlying server
- remote = Host('', 0, '')¶
 
- local = Host('127.0.0.1', 80, '127.0.0.1')¶
 
- host = ''¶
 
- class circuits.web.wrappers.Status¶
 Bases:
objectResponse Status
- class circuits.web.wrappers.Response(sock, request)¶
 Bases:
objectA Response object that holds the response to send back to the client. This ensure that the correct data is sent in the correct order.
Initializes x; see x.__class__.__doc__ for signature
- body¶
 Response Body
- status¶
 Response Status
- done = False¶
 
- close = False¶
 
- stream = False¶
 
- chunked = False¶
 
- prepare()¶