diff --git a/doc/api/cookies.rst b/doc/api/cookies.rst index 42c5463..4a60ded 100644 --- a/doc/api/cookies.rst +++ b/doc/api/cookies.rst @@ -1,16 +1,17 @@ - .. _cookies: -Cookies -------------- -Cookie support has been added to falcon from version 0.3. +Cookies +------- + +Cookie support is available in Falcon version 0.3 or later. .. _getting-cookies: + Getting Cookies -~~~~~~~~~~~~~ - -Cookie can be read from a request via the :py:attr:`~.Request.cookies` request attribute: +~~~~~~~~~~~~~~~ +Cookies can be read from a request via the :py:attr:`~.Request.cookies` +request attribute: .. code:: python @@ -31,7 +32,8 @@ The :py:attr:`~.Request.cookies` attribute is a regular for better performance. .. _setting-cookies: -Setting Cookies + +Setting Cookies ~~~~~~~~~~~~~~~ Setting cookies on a response is done via the :py:meth:`~.Response.set_cookie`. @@ -46,8 +48,6 @@ with the same name (which is how multiple cookies are sent to the client). header field, which is not compatible with the format used by `Set-Cookie` headers to send cookies to clients. - - Simple example: .. code:: python @@ -60,9 +60,6 @@ Simple example: You can of course also set the domain, path and lifetime of the cookie. - - - .. code:: python class Resource(object): diff --git a/doc/api/errors.rst b/doc/api/errors.rst index bf24f1b..26a5960 100644 --- a/doc/api/errors.rst +++ b/doc/api/errors.rst @@ -37,4 +37,4 @@ Predefined Errors HTTPMethodNotAllowed, HTTPNotAcceptable, HTTPConflict, HTTPLengthRequired, HTTPPreconditionFailed, HTTPUnsupportedMediaType, HTTPRangeNotSatisfiable, HTTPInternalServerError, HTTPBadGateway, - HTTPServiceUnavailable, + HTTPServiceUnavailable diff --git a/doc/community/contribute.rst b/doc/community/contribute.rst index 9bba246..bbc0c1e 100644 --- a/doc/community/contribute.rst +++ b/doc/community/contribute.rst @@ -35,13 +35,12 @@ doesn't make pyflakes sad. using the *help* function within a REPL, and when browsing them on *Read the Docs*. * Format non-trivial comments using your GitHub nick and an appropriate - prefix. Here are some examples: - .. code:: python + prefix. Here are some examples:: - # TODO(riker): Damage report! - # NOTE(riker): Well, that's certainly good to know. - # PERF(riker): Travel time to the nearest starbase? - # APPSEC(riker): In all trust, there is the possibility for betrayal. + # TODO(riker): Damage report! + # NOTE(riker): Well, that's certainly good to know. + # PERF(riker): Travel time to the nearest starbase? + # APPSEC(riker): In all trust, there is the possibility for betrayal. * Commit messages should be formatted using `AngularJS conventions`_ (one-liners are OK for now but bodies and footers may be required as the diff --git a/falcon/request.py b/falcon/request.py index ce35499..76dfe35 100644 --- a/falcon/request.py +++ b/falcon/request.py @@ -841,17 +841,11 @@ class Request(object): Returns: list: The value of the param if it is found. Otherwise, returns ``None`` unless required is True. Empty list elements will be - discarded. For example a query string containing this:: + discarded. For example, the following query strings would + both result in `['1', '3']`:: - things=1,,3 - - or a query string containing this:: - - things=1&things=&things=3 - - would both result in:: - - ['1', '3'] + things=1,,3 + things=1&things=&things=3 Raises: HTTPBadRequest: A required param is missing from the request. diff --git a/falcon/response.py b/falcon/response.py index 2173f7b..c8bd380 100644 --- a/falcon/response.py +++ b/falcon/response.py @@ -470,11 +470,11 @@ class Response(object): The tuple has the form (*start*, *end*, *length*), where *start* and *end* designate the byte range (inclusive), and *length* is the - total number of bytes, or '*' if unknown. You may pass ``int``'s for + total number of bytes, or '\*' if unknown. You may pass ``int``'s for these numbers (no need to convert to ``str`` beforehand). Note: - You only need to use the alternate form, 'bytes */1234', for + You only need to use the alternate form, 'bytes \*/1234', for responses that use the status '416 Range Not Satisfiable'. In this case, raising ``falcon.HTTPRangeNotSatisfiable`` will do the right thing.