Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Is there a convenient way when using the rest_framework.test.APIClient to make a DELETE request with query parameters? my_client.delete("/url/", {"foo": "bar"}) seems to always encode the data in the request body, and I haven't seen any option that would override that.

I know I can add the query params manually, something like my_client.delete("/url/?" + urllib.parse.urlencode({"foo": "bar"}), but that's a little awkward; I was hoping this would be possible with just the APIClient.

You must be logged in to vote

Replies: 1 comment

Comment options

Apparently in the next version (5.1?) query_params will be usable on any method https://docs.djangoproject.com/en/dev/topics/testing/tools/#django.test.Client.get

but in any previous version, it seems only url encoding is supported for delete and any non GET method in fact

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.