Skip to content

docs: outline the difference between JSON and form parsers. Fix #7633 #7634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api-guide/parsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Or, if you're using the `@api_view` decorator with function based views.

## JSONParser

Parses `JSON` request content.
Parses `JSON` request content. `request.data` will be populated with a dictionary of data.

**.media_type**: `application/json`

Expand Down
4 changes: 3 additions & 1 deletion docs/api-guide/requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ REST framework's Request objects provide flexible request parsing that allows yo

* It includes all parsed content, including *file and non-file* inputs.
* It supports parsing the content of HTTP methods other than `POST`, meaning that you can access the content of `PUT` and `PATCH` requests.
* It supports REST framework's flexible request parsing, rather than just supporting form data. For example you can handle incoming JSON data in the same way that you handle incoming form data.
* It supports REST framework's flexible request parsing, rather than just supporting form data. For example you can handle incoming [JSON data] similarly to how you handle incoming [form data].

For more details see the [parsers documentation].

Expand Down Expand Up @@ -136,5 +136,7 @@ Note that due to implementation reasons the `Request` class does not inherit fro

[cite]: https://groups.google.com/d/topic/django-developers/dxI4qVzrBY4/discussion
[parsers documentation]: parsers.md
[JSON data]: parsers.md#jsonparser
[form data]: parsers.md#formparser
[authentication documentation]: authentication.md
[browser enhancements documentation]: ../topics/browser-enhancements.md