mollie / mollie-api-python

Mollie API client for Python
http://www.mollie.com
BSD 2-Clause "Simplified" License
113 stars 55 forks source link

Python requests adds params to querystring, where it should be in the body for non-safe HTTP methods (POST/PATCH/DELETE/etc) #342

Open gabn88 opened 6 months ago

gabn88 commented 6 months ago

Specifications

Describe the issue

See https://github.com/psf/requests/blob/eea3bbf9ac635f465ee6c9903dc57c677952dafd/src/requests/api.py#L19 the params kwargs goes into the query string, whereas the data goes into the body.

I think this is the issue why I get:

Non-existent query parameter "testmode" for this API call. Did you mean: "include"?

When setting testmode to True.

For your reference this is where it goes wrong in the code: https://github.com/mollie/mollie-api-python/blob/f5464e4c3ab352ed874ac5a894f85c80c58df0c2/mollie/api/client.py#L180

fjbender commented 6 months ago

Which type of authentication are you using towards the Mollie API?

gabn88 commented 5 months ago

We use the 'setup_oauth' method (OAuth2Session authentication).

geertjanvdenbosch commented 2 days ago

Reopened because https://github.com/mollie/mollie-api-python/pull/361 will be reverted.