Guest User

Untitled

a guest
Feb 27th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #get
  2. curl -H 'Content-Type: application/json' url
  3.  
  4. #post
  5. curl -H 'Content-Type: application/json' -X POST -d "{'foo':'bar'}}" url
  6.  
  7. #pretty print
  8. curl -s -H 'Content-Type: application/json' url | python -m json.tool
  9.  
  10. #simple script, docs: http://docs.python.org/library/json.html
  11. curl -s -H 'Content-Type: application/json' url | \
  12. python -c "import sys, json; j = json.load(sys.stdin); print(j);"
Add Comment
Please, Sign In to add comment