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

fix: body encoding for rest transport #768

Merged
merged 2 commits into from
Feb 5, 2021

Conversation

vam-google
Copy link
Contributor

@vam-google vam-google commented Feb 5, 2021

Basically just replace json argument with data

Apparently, the json parameter in requests.Session.request() method does not expect JSON string, but expects python dictionary instead, which is not intuitive and does not even match the documentation of the method: https://github.com/psf/requests/blob/master/requests/sessions.py#L483.

At the same time in the Quickstart, it is explicitly said that json parameter was added in version 2.4.2 and expects python dict, while data argument can process raw encoded json string.

@vam-google vam-google requested a review from a team as a code owner February 5, 2021 00:46
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Feb 5, 2021
@vam-google vam-google changed the title fix: Fix body encoding for rest transport fix: body encoding for rest transport Feb 5, 2021
Basically just replace `json` argument with `data`

Apparently, the `json` parameter in requests.Session.request() method does not expect JSON string,
but expects python dictionary instead, which is not intuitive and does not even match the
documentation of the method: https://github.com/psf/requests/blob/master/requests/sessions.py#L483.

At the same time in the Quickstart, it is explicitly said that `json` parameter was added in
version `2.4.2` and expects python `dict`, while `data` argument can process raw encoded json
string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants