Trees | Indices | Help |
---|
|
object --+ | streams.WriteStream --+ | HttpServerResponse
Encapsulates a server-side HTTP response.
An instance of this class is created and associated to every instance of HttpServerRequest that is created.
It allows the developer to control the HTTP response that is sent back to the client for the corresponding HTTP request. It contains methods that allow HTTP headers and trailers to be set, and for a body to be written out to the response.
It also allows a file to be streamed by the kernel directly from disk to the outgoing HTTP connection, bypassing user space altogether (where supported by the underlying operating system). This is a very efficient way of serving files from the server since buffers do not have to be read one by one from the file and written to the outgoing socket.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
status_code = property(get_status_code, set_status_code)
|
|||
status_message = property(get_status_message, set_status_message)
|
|||
chunked = property(get_chunked, set_chunked)
|
|||
Inherited from |
|
|
Set the status code of the response. Default is 200 |
Get a copy of the reponse headers as a dictionary
|
Inserts a header into the response. Keyword arguments:
|
Get a copy of the trailers as a dictionary
|
Inserts a trailer into the response. Keyword arguments:
|
Write a buffer to the response. The handler (if supplied) will be called when the buffer has actually been written to the wire. Keyword arguments:
|
Write a String to the response. The handler will be called when the String has actually been written to the wire. Keyword arguments:
|
Tell the kernel to stream a file directly from disk to the outgoing connection, bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to serve files. Keyword arguments:
|
Sets whether this response uses HTTP chunked encoding or not. Keyword arguments:
|
Ends the response. If no data has been written to the response body, the actual response won't get written until this method gets called. Once the response has ended, it cannot be used any more, and if keep alive is true the underlying connection will be closed. Keywords arguments
|
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun Jan 13 17:19:26 2013 | http://epydoc.sourceforge.net |