7đź‘Ť
âś…
HTTP data elements can’t have sub-elements. The data you have posted – as shown in the querydict – has been interpreted as a single element with key “place[name]” and value “Starbucks”. So you can get it with request.POST["place[name]"]
.
👤Daniel Roseman
0đź‘Ť
It looks like you are sending a string, in that case try:
request.POST.get('place[name]')
If your are simulating a dropdown list you should send “place=Starbucks”, however if you are trying to send an array you should try to convert you string to an array inside your python script.
In your command you can get ride of “-X POST” as the parameter -d is already an HTTP POST:
curl --help
...
-d/--data <data> HTTP POST data (H)
curl manual:
http://curl.haxx.se/docs/manual.html
👤Kevin
- [Django]-Django. Remove select_related from queryset
- [Django]-Django development server keeps logging out
- [Django]-TypeError at /registration __init__() got an unexpected keyword argument 'null'
- [Django]-Django: Best way for simple hierarchy?
- [Django]-Display different templates based on host in Django
Source:stackexchange.com