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

Improve handling of kwargs passed to Requests #343

Merged
merged 1 commit into from Jan 4, 2021

Conversation

hemberger
Copy link
Contributor

We pass the form data to requests via data for POST methods, and
via params for GET methods. Therefore, we should be initializing
our data with the kwargs data or params respectively (whereas
previously we were initializing with data only).

Also added tests to check that we raise an exception when the kwargs
include a parameter that duplicates one of the args that we manually
set (i.e. url or method).

We pass the form data to requests via `data` for POST methods, and
via `params` for GET methods. Therefore, we should be initializing
our data with the kwargs `data` or `params` respectively (whereas
previously we were initializing with `data` only).

Also added tests to check that we raise an exception when the kwargs
include a parameter that duplicates one of the args that we manually
set (i.e. `url` or `method`).
@hemberger hemberger requested a review from moy November 2, 2020 20:12
@hemberger hemberger merged commit ad09c3c into MechanicalSoup:master Jan 4, 2021
@hemberger hemberger deleted the improve-kwargs branch January 4, 2021 19:31
ism pushed a commit to ism/MechanicalSoup that referenced this pull request Mar 4, 2021
We pass the form data to requests via `data` for POST methods, and
via `params` for GET methods. Therefore, we should be initializing
our data with the kwargs `data` or `params` respectively (whereas
previously we were initializing with `data` only).

Also added tests to check that we raise an exception when the kwargs
include a parameter that duplicates one of the args that we manually
set (i.e. `url` or `method`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant