Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
tornado.httpserver.HTTPRequest Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def cookies
def finish
def full_url
def get_ssl_certificate
def request_time
def supports_http_1_1
def write

Public Attributes

 arguments
 body
 connection
 files
 headers
 host
 method
 protocol
 query
 remote_ip
 uri
 version

Private Member Functions

def _valid_ip

Private Attributes

 _cookies
 _finish_time
 _start_time

Detailed Description

A single HTTP request.

All attributes are type `str` unless otherwise noted.

.. attribute:: method

   HTTP request method, e.g. "GET" or "POST"

.. attribute:: uri

   The requested uri.

.. attribute:: path

   The path portion of `uri`

.. attribute:: query

   The query portion of `uri`

.. attribute:: version

   HTTP version specified in request, e.g. "HTTP/1.1"

.. attribute:: headers

   `HTTPHeader` dictionary-like object for request headers.  Acts like
   a case-insensitive dictionary with additional methods for repeated
   headers.

.. attribute:: body

   Request body, if present, as a byte string.

.. attribute:: remote_ip

   Client's IP address as a string.  If `HTTPServer.xheaders` is set,
   will pass along the real IP address provided by a load balancer
   in the ``X-Real-Ip`` header

.. attribute:: protocol

   The protocol used, either "http" or "https".  If `HTTPServer.xheaders`
   is set, will pass along the protocol used by a load balancer if
   reported via an ``X-Scheme`` header.

.. attribute:: host

   The requested hostname, usually taken from the ``Host`` header.

.. attribute:: arguments

   GET/POST arguments are available in the arguments property, which
   maps arguments names to lists of values (to support multiple values
   for individual names). Names are of type `str`, while arguments
   are byte strings.  Note that this is different from
   `RequestHandler.get_argument`, which returns argument values as
   unicode strings.

.. attribute:: files

   File uploads are available in the files property, which maps file
   names to lists of :class:`HTTPFile`.

.. attribute:: connection

   An HTTP request is attached to a single HTTP connection, which can
   be accessed through the "connection" attribute. Since connections
   are typically kept open in HTTP/1.1, multiple requests can be handled
   sequentially on a single connection.

Definition at line 295 of file httpserver.py.


Constructor & Destructor Documentation

def tornado.httpserver.HTTPRequest.__init__ (   self,
  method,
  uri,
  version = "HTTP/1.0",
  headers = None,
  body = None,
  remote_ip = None,
  protocol = None,
  host = None,
  files = None,
  connection = None 
)

Definition at line 367 of file httpserver.py.


Member Function Documentation

Definition at line 469 of file httpserver.py.

def tornado.httpserver.HTTPRequest._valid_ip (   self,
  ip 
) [private]

Definition at line 476 of file httpserver.py.

A dictionary of Cookie.Morsel objects.

Definition at line 414 of file httpserver.py.

Finishes this HTTP request on the open connection.

Definition at line 431 of file httpserver.py.

Reconstructs the full URL for this request.

Definition at line 436 of file httpserver.py.

Returns the client's SSL certificate, if any.

To use client certificates, the HTTPServer must have been constructed
with cert_reqs set in ssl_options, e.g.::

    server = HTTPServer(app,
ssl_options=dict(
    certfile="foo.crt",
    keyfile="foo.key",
    cert_reqs=ssl.CERT_REQUIRED,
    ca_certs="cacert.crt"))

The return value is a dictionary, see SSLSocket.getpeercert() in
the standard library for more details.
http://docs.python.org/library/ssl.html#sslsocket-objects

Definition at line 447 of file httpserver.py.

Returns the amount of time it took for this request to execute.

Definition at line 440 of file httpserver.py.

Returns True if this request supports HTTP/1.1 semantics

Definition at line 409 of file httpserver.py.

def tornado.httpserver.HTTPRequest.write (   self,
  chunk,
  callback = None 
)
Writes the given chunk to the response stream.

Definition at line 426 of file httpserver.py.


Member Data Documentation

Definition at line 414 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.

Definition at line 367 of file httpserver.py.


The documentation for this class was generated from the following file:


roswww
Author(s): Jonathan Mace
autogenerated on Thu Jan 2 2014 11:53:30