Tuesday, June 2, 2015

Re: dhango class based views - Saving post data

Just to add, if I use a curl request 

curl -H  "Authorization: Bearer $usertoken" -H "Content-Type: application/json" -X POST -d '{"user":"foo1","stock":"XYZ","prefs":"Likes"}' http://${endpoint}/addPrefs

I get a error: {"prefs":["\"Likes\" is not a valid choice."]}

If I use

curl -H  "Authorization: Bearer $usertoken" -H "Content-Type: application/json" -X POST -d '{"user":"foo1","stock":"XYZ","prefs":"1"}' http://${endpoint}/addPrefs

I get the above trace. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7ca2a02f-596e-40da-9a16-2b2011871e02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment