Skip to content
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

Unclear documentation on 'Request' object #2598

Closed
rangerscience opened this issue Jan 16, 2018 · 4 comments
Closed

Unclear documentation on 'Request' object #2598

rangerscience opened this issue Jan 16, 2018 · 4 comments

Comments

@rangerscience
Copy link

rangerscience commented Jan 16, 2018

Regarding this documentation: http://flask.pocoo.org/docs/0.12/api/#incoming-request-data

(Note: I'd just edit and PR myself, but I can't find these docs in this repo, or any instructions for contributing to it)

  1. What mime-types does Flask recognize, and what does it do when it encounters them?
  2. Reading data also reads stream, so if you call data and then stream, stream will be empty.
  3. Similarly, reading stream before data results in an empty data
  4. Sending a JSON payload in a GET request results in a populated form attribute (which, as per docs, only populates on POST and PUT)

These are very much not clear from the documentation, and led me to great frustration.

Note 2: Although it's reasonable that form does not automagically take JSON payloads and interpret them as form data.... it might be nice to point that out explicitly, given how much use JSON has.

@davidism
Copy link
Member

This is part of Werkzeug. You may open a PR there if you can make the docs more clear.

@rangerscience
Copy link
Author

The Flask documentation is part of Werkzeug? I thought they were different projects.

@davidism
Copy link
Member

The request class is from Werkzeug. Flask renders some docstrings from there.

@rangerscience
Copy link
Author

Do you know if the documentation I linked to is present in either this repo, or the main Werkzeug repo (https://github.com/pallets/werkzeug)?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants