Package core :: Module http :: Class HttpServerRequest |
[hide private]
[frames] | no frames]

# Class HttpServerRequest

source code

            object --+
                     |
    streams.ReadStream --+
                         |
                        HttpServerRequest

Encapsulates a server-side HTTP request.

An instance of this class is created for each request that is handled by the server and is passed to the user via the handler specified using HttpServer.request_handler.

Each instance of this class is associated with a corresponding HttpServerResponse instance via the property response.

Instance Methods | [hide private]
__init__(self, java_obj) | source code
method(self) The HTTP method, one of HEAD, OPTIONS, GET, POST, PUT, DELETE, CONNECT, TRACE | source code
uri(self) The uri of the request. | source code
path(self) The path part of the uri. | source code
query(self) The query part of the uri. | source code
params(self) The request parameters as a dictionary | source code
response(self) The response HttpServerResponse object. | source code
headers(self) The request headers as a dictionary | source code
body_handler(self, handler) Set the body handler for this request, the handler receives a single Buffer object as a parameter. | source code
_to_java_request(self) | source code
Inherited from `streams.ReadStream`: `data_handler`, `end_handler`, `exception_handler`, `pause`, `resume` Inherited from `streams.ReadStream` (private): `_to_read_stream`

Method Details | [hide private]

### __init__(self, java_obj) (Constructor) | source code
Overrides: object.__init__ (inherited documentation)

### method(self) | source code
The HTTP method, one of HEAD, OPTIONS, GET, POST, PUT, DELETE, CONNECT, TRACE Decorators: `@property`

### uri(self) | source code
The uri of the request. For example 'http://www.somedomain.com/somepath/somemorepath/somresource.foo?someparam=32&someotherparam=x Decorators: `@property`

### path(self) | source code
The path part of the uri. For example /somepath/somemorepath/somresource.foo Decorators: `@property`

### query(self) | source code
The query part of the uri. For example someparam=32&someotherparam=x Decorators: `@property`

### params(self) | source code
The request parameters as a dictionary Decorators: `@property`

### response(self) | source code
The response HttpServerResponse object. Decorators: `@property`

### headers(self) | source code
The request headers as a dictionary Decorators: `@property`

### body_handler(self, handler) | source code
Set the body handler for this request, the handler receives a single Buffer object as a parameter. This can be used as a decorator. Keyword arguments: Parameters: `handler` - a handler that is called when the body has been received. The handler is wrapped in a BufferHandler.