On Wed, Sep 21, 2011 at 11:43 AM, Tom Evans <tevans...@googlemail.com>wrote:

>
> On Wed, Sep 21, 2011 at 11:33 AM, Kayode Odeyemi <drey...@gmail.com>
> wrote:
> > 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.
>
> The problem is not the content-type. It's because of the space in between
--data and 'fees=

I've fixed that and it worked :)

Thanks anyway

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.
>
> It worked yesterday and worked today. I hope it works tomorrow :)


-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to