-
-
Notifications
You must be signed in to change notification settings - Fork 948
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify behavior between asgi and wsgi (#1695)
* refactor(requrest): avoid duplication of prefix, add get_media to wsgi method * refactor(response): add render_body to wsgi response. Also unify data and media behavior between asgi and wsgi * test(response): additional tests to render_body * docs: add newsfragment * docs: fix typo in changelog * doc(falcon.Response): Expand news fragment for render_body() * doc(Response): Update docstrings for render_body() * doc(Response): Update docstrings for media and get_body() * doc(Request): Add news fragment re get_media() Fixes #1679 Partially-Implements #1358 Co-authored-by: Vytautas Liuolia <vytautas.liuolia@gmail.com> Co-authored-by: Kurt Griffiths <mail@kgriffs.com>
- Loading branch information
1 parent
b437e5e
commit 09e1220
Showing
14 changed files
with
238 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The :attr:`falcon.Response.data` property now just simply returns the same data | ||
object that it was set to, if any, rather than also checking and serializing | ||
the value of the :attr:`falcon.Response.media` property. Instead, a new | ||
:meth:`~falcon.Response.render_body` method has been implemented, which can be | ||
used to obtain the HTTP response body for the request, taking into account | ||
the :attr:`~falcon.Response.body`, :attr:`~falcon.Response.data`, and | ||
:attr:`~falcon.Response.media` attributes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
A new method, :meth:`~falcon.Request.get_media`, was added that can now be used | ||
instead of the :attr:`falcon.Request.media` property to make it more clear to | ||
app maintainers that getting the media object for a request involves a | ||
side-effect of consuming and deserializing the body stream. The original | ||
property remains available to ensure backwards-compatibility with existing apps. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.