tortik.page.RequestHandler — base class for request handle¶
Base class for request handle¶
-
class
tortik.page.RequestHandler(application, request, **kwargs)[source]¶ Base handler for request handle
Differs from
tornado.web.RequestHandlerthat all method handlers are@tornado.web.asynchronousby default.Handler completion should be done with
self.completemethod instead ofself.finishfor applying postprocessors.
RequestHandler¶
Methods¶
-
RequestHandler.make_request(name, method='GET', full_url=None, url_prefix=None, path='', data='', headers=None, connect_timeout=1, request_timeout=2, follow_redirects=True, **kwargs)[source]¶ Class for easier constructing
tornado.httpclient.HTTPRequestobject.Request url could be constructed with two ways:
full_urlargumenturl_prefixas domain part andpathas path part
Parameters: - name (string) – Name of the request (for later accessing response through
self.responses.get(name)) - method (string) – HTTP method, e.g. “GET” or “POST”
- full_url (string) – Full url for the requesting server (ex.
http://example.com) - url_prefix (string) – Request url domain part
- path (string) – Request url path part
- data (
stringordict) – Query to be passed to the request (could be a dict and would be translated to a query string) - headers (
tornado.httputil.HTTPHeadersordict) – Additional HTTP headers to pass on the request - connect_timeout (float) – Timeout for initial connection in seconds
- request_timeout (float) – Timeout for entire request in seconds
- follow_redirects (bool) – Should redirects be followed automatically or return the 3xx response?
- kwargs – any other
tornado.httpclient.HTTPRequestarguments
Returns: tornado.httpclient.HTTPRequest