I am using tastypie with django. I have one line of code:
data = self.deserialize(request, request.body, format=request.META.get('CONTENT_TYPE', 'application/json'))
I use this code from the command line to send a mail request to my web server:
curl -X post -d "{ 'username' : 'user', 'password' : 'password' }" http://127.0.0.1:8000/api/employee/login/ --header "Content-Type:application/json"
When I run this, it leads to json response
{"error": ""}
Looking at the logs of my server, I see:
[15/Feb/2014 20:39:49] "post /api/user/login/ HTTP/1.1" 400 13
A log message recorded immediately before the deserialization string is successfully logged, but a log message recorded immediately after the deserialization string is not logged, so I am sure that the deserialization is incorrect. Does anyone know what might be wrong, or if I should consider something else as a problem?
Swiss source
share