Skip to content

Commit

Permalink
docs(FAQ): update faq.rst (missing query params section) (falconry#1968)
Browse files Browse the repository at this point in the history
* docs: update faq.rst missing query params section

To reflect the current `keep_blank_qs_values` default value

Closes falconry#1964

* docs(FAQ): tweak the "query param missing" FAQ item

Co-authored-by: Vytautas Liuolia <[email protected]>
  • Loading branch information
vgerak and vytas7 authored Oct 13, 2021
1 parent 9a7aca2 commit 9152c53
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docs/user/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,17 @@ in for either path will be sent to the same resource.

Why is my query parameter missing from the req object?
------------------------------------------------------
If a query param does not have a value, Falcon will by default ignore that
parameter. For example, passing ``'foo'`` or ``'foo='`` will result in the
parameter being ignored.

If you would like to recognize such parameters, you must set the
`keep_blank_qs_values` request option to ``True``. Request options are set
globally for each instance of :class:`falcon.API` via the
If a query param does not have a value and the
:attr:`~falcon.RequestOptions.keep_blank_qs_values` request option is set to
``False`` (the default as of Falcon 2.0+ is ``True``), Falcon will ignore that
parameter.
For example, passing ``'foo'`` or ``'foo='`` will result in the parameter being
ignored.

If you would like to recognize such parameters, the
:attr:`~falcon.RequestOptions.keep_blank_qs_values` request option should be
set to ``True`` (or simply kept at its default value in Falcon 2.0+). Request
options are set globally for each instance of :class:`falcon.App` via the
:attr:`~falcon.App.req_options` property. For example:

.. code:: python
Expand Down

0 comments on commit 9152c53

Please sign in to comment.