Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 27th, 2012  |  syntax: None  |  size: 0.39 KB  |  views: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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);"
clone this paste RAW Paste Data