Usage

Hello World:

  1. $ http httpie.org

Synopsis:

  1. $ http [flags] [METHOD] URL [ITEM [ITEM]]

See also http —help.

Examples

Custom HTTP method, HTTP headers and JSON data:

  1. $ http PUT example.org X-API-Token:123 name=John

Submitting forms:

  1. $ http -f POST example.org hello=World

See the request that is being sent using one of the output options:

  1. $ http -v example.org

Use Github API to post a comment on anissuewith authentication:

  1. $ http -a USERNAME POST https://api.github.com/repos/jakubroztocil/httpie/issues/83/comments body='HTTPie is awesome! :heart:'

Upload a file using redirected input:

  1. $ http example.org < file.json

Download a file and save it via redirected output:

  1. $ http example.org/file > file

Download a file wget style:

  1. $ http --download example.org/file

Use named sessions to make certain aspects or the communication persistentbetween requests to the same host:

  1. $ http --session=logged-in -a username:password httpbin.org/get API-Key:123
  2.  
  3. $ http --session=logged-in httpbin.org/headers

Set a custom Host header to work around missing DNS records:

  1. $ http localhost:8000 Host:example.com