67👍
✅
Starting at Django 1.5, request.POST
does not contain non-form data anymore. They are now in request.body
.
https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.POST
1👍
I’m not a cURL expect but copying a POST request out of Chrome dev tools my --data
looked as follows:
--data "foo=bar&bar=foo"
So it looks like you might want to change your command to:
--data item_id="1"
Side note:
I can highly recommend either of the following Chrome apps for making HTTP requests:
Advanced REST client OR Dev HTTP Client
Additionally if you can make the call in a browser (form submit or such like) then in Chrome dev tools network panel you can copy the request as a cURL command (right click on it)
- Django makemigrations not detecting project/apps/myapp
- Executing a Django Shell Command from the Command Line
- Make Django test case database visible to Celery
Source:stackexchange.com