python - No JSON object could be decoded - tastypie - curl -


I was following the term tastypie tutorial for the word until I reach the post section:

When I leave this command I keep the following error: No JSON object can be decoded

I checked and I am sure that I I'm following the term of the documentation.

Thank you for your help

having a window object with curl I

  1. JSON data should be cited with double quotes ("") instead of single quotes.
  2. All double quotes in Jason Packets must be saved from a backslash (\)

    Example: So, this:

    Curl - Dump-Header - - "Content-Type: Application / Jason" -X Post - Data '{"Body": "This Will Be the First Post To Me", "Pub_Date": "2011-05-22 T00 : 46: 38 "," Slug ":" second-post "," title ":" other post "," user ":" / api / v1 / user / 1 / "} 'http: // localhost: 8000 / Api / v1 / entry /

    should be:

    curl - dump-header - -h "content-type: application / jason" -ex paus T --Data "{\" body \ ": \" It will be the first of my post \ ", \" pub_date \ ": \" 2011-05-22T00: 46: 38 \ ", \" slug \ ": \ "Another post \", \ "title \": \ "another post \", \ "user \": \ "/ api / v1 / user / 1 / \"} "http: // localhost: 8000 / Api / v1 / entry /

Comments