Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

These are slides from a "mini-talk" (~15 minutes) I recently gave on httpie.

Published in: Technology, Design
  • Be the first to comment


  1. 1. Scott Leberknight
  2. 2. "HTTPie: a CLI, cURL-like tool for humans" -
  3. 3. "HTTPie is a command line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible." -
  4. 4. Implemented in Python Provides simple http command Colorized, formatted output
  5. 5. pip install --upgrade httpie Installation or easy_install httpie or yum install httpie (etc.)
  6. 6. Major Features colorized output output formatting query/form parameters security (auth, https) headers form file uploads persistent sessions supports all HTTP verbs wget-style downloads streamed responses
  7. 7. Usage http [flags] [METHOD] URL [REQUEST ITEMS]
  8. 8. 3 cool sites to test with:
  9. 9. Let's try it...
  10. 10. Hello World http
  11. 11. -v (verbose)
  12. 12. Defaults... method - GET scheme - http:// data fields - JSON
  13. 13. Request Headers http Accept:application/json X-Test-Header:'Foo, Bar' Name:Value
  14. 14. URL parameters name==value http search=='curl vs. httpie' page==2
  15. 15. Data Fields (JSON) field=value field=@file.txt http search='curl vs. httpie' page=2
  16. 16. ...httpie will set the method to POST when a request contains data fields...
  17. 17. Data Fields (from a file) http data=@/Users/sleberkn/w.txt
  18. 18. Data Fields (form) -f, --form field=value field=@file.txt http --form search='curl vs. httpie' page=2
  19. 19. ...httpie will set the content type to application/x-www-form-urlencoded when you use --form ( or -f )...
  20. 20. Raw JSON field:=value field:=@file.txt http terms:='["curl", "vs.", "httpie"]' page:=2
  21. 21. File Uploads field@/dir/file_name http the_file@/Users/sleberkn/w.txt
  22. 22. ...httpie will set the content type to multipart/form-data when you do a file upload...
  23. 23. Easy as httpie!
  24. 24. HTTP Methods GET POST PUT PATCH DELETE HEAD (and a few more obscure ones...)
  25. 25. Testing methods with http GET http POST foo=bar http PUT foo=bar http PATCH foo=bar http -f DELETE
  26. 26. Authentication BASIC (default) or Digest -a,--auth --auth-type Has plugins for OAuth & others
  27. 27. Username & password
  28. 28. Username & password prompt
  29. 29. Downloads -d,--download -o,--output http -d -o out.txt
  30. 30. Persistent Sessions Custom headers, authorization, and cookies persist between requests to the same host Named & anonymous sessions
  31. 31. http --session=user1 -a user1:secret X-Thingy:Foo http --session=user2 -a user2:monkey Named Sessions
  32. 32. Other stuff... HTTPS support Supports proxies Redirect to/from http Control output via flags (--headers, --body, --print, etc.) JSON config file Scripting support (via --check-status) Streaming responses
  33. 33. httpie web site: (redirects to ) References httpbin HTTP request & response service: RequestBin:
  34. 34. My Info twitter: sleberknight scott dot leberknight at