#20574: Django Client Put Method Data is not Send
-------------------------------------+-------------------------------------
Reporter: edwinlunando | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: 1.5
Severity: Normal | Resolution:
Keywords: Test, Client, Put, | worksforme
Data | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bak1an):
* status: new => closed
* resolution: => worksforme
Comment:
Hi edwinlunando.
{{{
data = {
'access_token': access_token.token
}
response = self.client.put(reverse('api:update_user'), data)
}}}
In this case you should be able to find your data in `request.body`.
Please note that PUT and DELETE methods are not designed to transmit data
within query string, so setting it to `urlencode(data, doseq=True)` for
all requests will be not correct (but if you want it for some reason - you
can urlencode your data when building url for request, e.g.
`self.client.put(reverse('api:update_user')+'?'+urlencode(data,
doseq=True))`).
Also, here is kind of related ticket - #12635.
I'm closing this ticket as worksforme, but feel free to reopen if
`request.body` is really empty and you think that it is because of some
django's bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/20574#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.835d0bc660fff397f9715211990f363e%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.