Skip to content

Do not send JSON body in GET requests#382

Merged
zippolyte merged 2 commits intomasterfrom
hippo/400
May 31, 2019
Merged

Do not send JSON body in GET requests#382
zippolyte merged 2 commits intomasterfrom
hippo/400

Conversation

@zippolyte
Copy link
Copy Markdown
Contributor

The EU instance (api.datadoghq.eu) refuses GET requests with a body (even if empty JSON dict {}) and responds with 400 Bad Request.
This PR simply set the body to None when making GET requests.

Fixes #375

Copy link
Copy Markdown
Contributor

@nmuesch nmuesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Approving but do you think its worthwhile to add a test on this here - https://github.com/DataDog/datadogpy/blob/master/tests/integration/api/test_api.py ?

(req_method, req_url), others = self.request_mock.call_args()
self.assertEquals(method, req_method, req_method)
self.assertEquals(url, req_url, req_url)
self.assertEqual(method, req_method, req_method)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💜 on updating this to its non deprecated alias 😄

Copy link
Copy Markdown
Contributor

@nmuesch nmuesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the tests.

@zippolyte zippolyte merged commit 94f437a into master May 31, 2019
@zippolyte zippolyte deleted the hippo/400 branch May 31, 2019 09:18
dabcoder pushed a commit to dabcoder/datadogpy that referenced this pull request Oct 25, 2019
dabcoder pushed a commit to dabcoder/datadogpy that referenced this pull request Nov 28, 2019
This was referenced Jun 19, 2021
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.

api.Monitor.search() returns "400 malformed request" html

2 participants