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
On Wed, Sep 21, 2011 at 11:33 AM, Kayode Odeyemi <dre...@gmail.com> wrote:I don't know why you cross posted this to django-developers.
> Hello friends,
>
> I don't know why Django is so unstable.
Thats not x-www-form-urlencoded data, so expecting django to parse it
>
> 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
is not going to happen. Django parses x-www-form-urlencoded data.
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.
On Wed, Sep 21, 2011 at 11:33 AM, Kayode Odeyemi <dre...@gmail.com> wrote:Thats not x-www-form-urlencoded data, so expecting django to parse it
> 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
is not going to happen. Django parses x-www-form-urlencoded data.
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, the snarky tone is un-called-for and not OK. Cross-posting is
against our normal standards, but there's not reason for Kayode to
have known that. Please try to be nice when telling people about our
community standards.
And Kayode: I think you'll find you have a lot more luck getting your
questions answered if you're polite and don't insult the work of a
bunch of volunteers. Calling Django "unstable" is a really bad way to
motivate the people who wrote it to try to help you out.
Remember folks: at the other end of that email is "a real person, a
lot like you" (http://sivers.org/real).
Jacob