django - Sending POST parameters from apiary -


i have created rest api using django. i'm making post request parameters

user_id="5453ab249b0dbb3b76000009" user_type="instrcutor" 

in apiary blueprint , i'm sending these part of request body like:

+ request (application/json)      + body                      {                 "user_id": "5453ab249b0dbb3b76000009",                 "user_type": "instructor"             } 

but in django view , request.post coming like:

{u'{\n        "user_id": "5453ab249b0dbb3b76000009",\n        "user_type": "instructor"\n}': [u'']} 

instead of

{u'user_id': [u'5453ab249b0dbb3b76000009'], u'user_type': [u'instructor']} 

how can send post data correctly ?

edit

here solution:

+ request (application/x-www-form-urlencoded)      user_id=5453ab249b0dbb3b76000009&user_type=instructor 

if apiary sending json (you wrote in body block), should , parse request.body instead of request.post


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -