mollie-api-python icon indicating copy to clipboard operation
mollie-api-python copied to clipboard

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

Open gabn88 opened this issue 1 year ago • 2 comments

Specifications

  • API Version: 3.6.0

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

gabn88 avatar Feb 27 '24 13:02 gabn88

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

fjbender avatar Feb 27 '24 13:02 fjbender

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

gabn88 avatar Mar 08 '24 13:03 gabn88

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

geertjanvdenbosch avatar Aug 26 '24 10:08 geertjanvdenbosch