From: Ben Darnell Date: Sun, 23 Feb 2014 20:57:18 +0000 (-0500) Subject: Fix doc references to HTTPRequest. X-Git-Tag: v4.0.0b1~91^2~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d7e37c0c322152805c0d033915b2d309d16a199;p=thirdparty%2Ftornado.git Fix doc references to HTTPRequest. --- diff --git a/docs/httpserver.rst b/docs/httpserver.rst index 4498d0911..88c74376b 100644 --- a/docs/httpserver.rst +++ b/docs/httpserver.rst @@ -3,15 +3,7 @@ .. automodule:: tornado.httpserver - ``HTTPRequest`` objects - ----------------------- - .. autoclass:: HTTPRequest - :members: - HTTP Server ----------- .. autoclass:: HTTPServer :members: - - .. autoclass:: HTTPConnection - :members: diff --git a/docs/overview.rst b/docs/overview.rst index 0ccbbcb33..438dd657c 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -115,7 +115,7 @@ number of useful attributes, including: - ``path`` - the request path (everything before the ``?``) - ``headers`` - the request headers -See the class definition for `tornado.httpserver.HTTPRequest` for a +See the class definition for `tornado.httputil.HTTPServerRequest` for a complete list of attributes. Overriding RequestHandler methods diff --git a/docs/releases/v2.1.0.rst b/docs/releases/v2.1.0.rst index c569be9ed..9006f116d 100644 --- a/docs/releases/v2.1.0.rst +++ b/docs/releases/v2.1.0.rst @@ -67,7 +67,7 @@ New modules * To facilitate some advanced multi-process scenarios, ``HTTPServer`` has a new method ``add_sockets``, and socket-opening code is available separately as `tornado.netutil.bind_sockets`. -* The ``cookies`` property is now available on `tornado.httpserver.HTTPRequest` +* The ``cookies`` property is now available on ``tornado.httpserver.HTTPRequest`` (it is also available in its old location as a property of `~tornado.web.RequestHandler`) * ``tornado.httpserver.HTTPServer.bind`` now takes a backlog argument with the diff --git a/docs/releases/v2.3.0.rst b/docs/releases/v2.3.0.rst index 5d7674d36..368ceec96 100644 --- a/docs/releases/v2.3.0.rst +++ b/docs/releases/v2.3.0.rst @@ -30,7 +30,7 @@ HTTP Server * `.HTTPServer` now works correctly with paths starting with ``//`` * ``HTTPHeaders.copy`` (inherited from `dict.copy`) now works correctly. * ``HTTPConnection.address`` is now always the socket address, even for non-IP - sockets. `.HTTPRequest.remote_ip` is still always an IP-style address + sockets. ``HTTPRequest.remote_ip`` is still always an IP-style address (fake data is used for non-IP sockets) * Extra data at the end of multipart form bodies is now ignored, which fixes a compatibility problem with an iOS HTTP client library. diff --git a/docs/releases/v3.0.0.rst b/docs/releases/v3.0.0.rst index e618641f5..b96f89241 100644 --- a/docs/releases/v3.0.0.rst +++ b/docs/releases/v3.0.0.rst @@ -177,7 +177,7 @@ Multiple modules * `.HTTPServer` now takes a ``protocol`` keyword argument which can be set to ``https`` if the server is behind an SSL-decoding proxy that does not set any supported X-headers. -* `tornado.httpserver.HTTPConnection` now has a ``set_close_callback`` +* ``tornado.httpserver.HTTPConnection`` now has a ``set_close_callback`` method that should be used instead of reaching into its ``stream`` attribute. * Empty HTTP request arguments are no longer ignored. This applies to diff --git a/docs/releases/v3.1.0.rst b/docs/releases/v3.1.0.rst index 7b0609271..edbf39dba 100644 --- a/docs/releases/v3.1.0.rst +++ b/docs/releases/v3.1.0.rst @@ -78,7 +78,7 @@ Multiple modules HTTP 1.0 connections that explicitly pass ``Connection: keep-alive``. * The ``Connection: keep-alive`` check for HTTP 1.0 connections is now case-insensitive. -* The `str` and `repr` of `tornado.httpserver.HTTPRequest` no longer +* The `str` and `repr` of ``tornado.httpserver.HTTPRequest`` no longer include the request body, reducing log spam on errors (and potential exposure/retention of private data). diff --git a/docs/releases/v3.2.0.rst b/docs/releases/v3.2.0.rst index 7e5299e9f..5f2a694c8 100644 --- a/docs/releases/v3.2.0.rst +++ b/docs/releases/v3.2.0.rst @@ -156,7 +156,7 @@ New modules individual aspects of debug mode. * New methods `.RequestHandler.get_query_argument` and `.RequestHandler.get_body_argument` and new attributes - `.HTTPRequest.query_arguments` and `.HTTPRequest.body_arguments` allow access + ``HTTPRequest.query_arguments`` and ``HTTPRequest.body_arguments`` allow access to arguments without intermingling those from the query string with those from the request body. * `.RequestHandler.decode_argument` and related methods now raise diff --git a/docs/web.rst b/docs/web.rst index 104f686eb..52c74501b 100644 --- a/docs/web.rst +++ b/docs/web.rst @@ -40,7 +40,7 @@ .. automethod:: RequestHandler.decode_argument .. attribute:: RequestHandler.request - The `tornado.httpserver.HTTPRequest` object containing additional + The `tornado.httputil.HTTPServerRequest` object containing additional request parameters including e.g. headers and body data. .. attribute:: RequestHandler.path_args diff --git a/tornado/httpserver.py b/tornado/httpserver.py index 42f10c8b6..e30bc32f5 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -20,8 +20,10 @@ Typical applications have little direct interaction with the `HTTPServer` class except to start a server at the beginning of the process (and even that is often done indirectly via `tornado.web.Application.listen`). -This module also defines the `HTTPRequest` class which is exposed via -`tornado.web.RequestHandler.request`. +.. versionchanged:: 3.3 + + The ``HTTPRequest`` class that used to live in this module has been moved + to `tornado.httputil.HTTPServerRequest`. The old name remains as an alias. """ from __future__ import absolute_import, division, print_function, with_statement @@ -36,7 +38,7 @@ class HTTPServer(TCPServer): A server is defined by a request callback that takes an HTTPRequest instance as an argument and writes a valid HTTP response with - `HTTPRequest.write`. `HTTPRequest.finish` finishes the request (but does + `.HTTPServerRequest.write`. `.HTTPServerRequest.finish` finishes the request (but does not necessarily close the connection in the case of HTTP/1.1 keep-alive requests). A simple example server that echoes back the URI you requested:: diff --git a/tornado/httputil.py b/tornado/httputil.py index 1ca54bc8a..fac21ec08 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -14,7 +14,11 @@ # License for the specific language governing permissions and limitations # under the License. -"""HTTP utility code shared by clients and servers.""" +"""HTTP utility code shared by clients and servers. + +This module also defines the `HTTPServerRequest` class which is exposed +via `tornado.web.RequestHandler.request`. +""" from __future__ import absolute_import, division, print_function, with_statement diff --git a/tornado/web.py b/tornado/web.py index 2d9908055..2c11f2bc1 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -455,7 +455,7 @@ class RequestHandler(object): @property def cookies(self): - """An alias for `self.request.cookies <.httpserver.HTTPRequest.cookies>`.""" + """An alias for `self.request.cookies <.httputil.HTTPServerRequest.cookies>`.""" return self.request.cookies def get_cookie(self, name, default=None): @@ -2257,7 +2257,7 @@ class FallbackHandler(RequestHandler): """A `RequestHandler` that wraps another HTTP server callback. The fallback is a callable object that accepts an - `~.httpserver.HTTPRequest`, such as an `Application` or + `~.httputil.HTTPServerRequest`, such as an `Application` or `tornado.wsgi.WSGIContainer`. This is most useful to use both Tornado ``RequestHandlers`` and WSGI in the same server. Typical usage:: diff --git a/tornado/wsgi.py b/tornado/wsgi.py index f21f240c2..62423259c 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -135,7 +135,7 @@ class WSGIApplication(web.Application): class HTTPRequest(object): - """Mimics `tornado.httpserver.HTTPRequest` for WSGI applications.""" + """Mimics `tornado.httputil.HTTPServerRequest` for WSGI applications.""" def __init__(self, environ): """Parses the given WSGI environment to construct the request.""" self.method = environ["REQUEST_METHOD"] @@ -291,7 +291,7 @@ class WSGIContainer(object): @staticmethod def environ(request): - """Converts a `tornado.httpserver.HTTPRequest` to a WSGI environment. + """Converts a `tornado.httputil.HTTPServerRequest` to a WSGI environment. """ hostport = request.host.split(":") if len(hostport) == 2: