On Wed, Sep 21, 2011 at 11:33 AM, Kayode Odeyemi <[email protected]> wrote:
> Hello friends,
>
> I don't know why Django is so unstable.
I don't know why you cross posted this to django-developers.
>
> Before restarting my computer everything works fine. Django could parse a
> simple
> POST request without complaining KeyError.
>
> I'm simply making a POST request like this:
>
> curl -v -H "Content-Type: application/json" -A 'Mozilla' -X POST --data
> 'fees={"fees":{"status":"pending","timeout":5},
> "hostel":{"status":"pending","timeout": 3}}'
> http://127.0.0.1:8000/api/transaction/add/ > post_data.txt
Thats not x-www-form-urlencoded data, so expecting django to parse it
is not going to happen. Django parses x-www-form-urlencoded data.
>
> I also have it in valid dict format like this:
>
> curl -v -H "Content-Type: application/json" -X POST --data
> 'fees={"fees":[("status","pending"),("timeout",5)],
> "hostel":[("status","pending"),("timeout", 3)]'
> http://127.0.0.1:8000/api/transaction/add/ > post_data.txt
>
> This worked throughout yesterday. Just hoping to continue from where I left
> off, and I can't progress as I would love to.
>
It didn't work yesterday, you are mistaken. Django has never
automatically parsed json encoded post data, so if you think it did
yesterday, you are wrong.
Tom
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.