TestClient: Allow params with empty values in POST #2268

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@ramn

ramn commented Feb 12, 2014

The test HTTP client allows us to send query params where the value is
empty when using GET. When using POST on the other hand, sending the
empty list as the value will remove the key/value pair entirely.
Make this behaviour symmetrical and allow keys with empty values also
for POST.

Simon Andersson
TestClient: Allow params with empty values in POST
The test HTTP client allows us to send query params where the value is
empty when using GET. When using POST on the other hand, sending the
empty list as the value will remove the key/value pair entirely.
Make this behaviour symmetrical and allow keys with empty values also
for POST.
@apollo13

This comment has been minimized.

Show comment Hide comment
@apollo13

apollo13 Feb 13, 2014

Member

Hi, please open a ticket for this first, see https://github.com/django/django/blob/master/CONTRIBUTING.rst -- I am also not sure if sending an empty list makes sense, eg using .getlist you'd get ?data=a&data=b for GET and `` (nothing) if the list is empty, so the current GET behavior might be buggy instead!

Member

apollo13 commented Feb 13, 2014

Hi, please open a ticket for this first, see https://github.com/django/django/blob/master/CONTRIBUTING.rst -- I am also not sure if sending an empty list makes sense, eg using .getlist you'd get ?data=a&data=b for GET and `` (nothing) if the list is empty, so the current GET behavior might be buggy instead!

@apollo13 apollo13 closed this Feb 13, 2014

@ramn

This comment has been minimized.

Show comment Hide comment
@ramn

ramn Feb 17, 2014

I have opened a ticket: https://code.djangoproject.com/ticket/22079

Either GET or POST is buggy, but I think they should work the same.

ramn commented Feb 17, 2014

I have opened a ticket: https://code.djangoproject.com/ticket/22079

Either GET or POST is buggy, but I think they should work the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment