From 1d062a94f05793e921deb603ed44208dc5841765 Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Sun, 28 Feb 2016 18:17:45 +0800 Subject: [PATCH] http: add --- pages/common/http.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pages/common/http.md diff --git a/pages/common/http.md b/pages/common/http.md new file mode 100644 index 000000000..3203b3799 --- /dev/null +++ b/pages/common/http.md @@ -0,0 +1,39 @@ +# http + +> HTTPie: HTTP client, a user-friendly cURL replacement. + +- Download a URL to a file: + +`http -d {{example.org}}` + +- Send form-encoded data: + +`http -f {{example.org}} {{name='bob'}} {{profile-picture@'bob.png'}}` + +- Send JSON object: + +`http {{example.org}} {{name='bob'}}` + +- Specify an HTTP method: + +`http {{HEAD}} {{example.org}}` + +- Include an extra header: + +`http {{example.org}} {{X-MyHeader:123}}` + +- Pass a user name and password for server authentication: + +`http -a {{username:password}} {{example.org}}` + +- Specify raw request body via stdin: + +`cat data.txt | http PUT example.org` + +- View both the response and the request being sent: + +`http -v {{example.org}}` + +- Send JSON object with non-string fields: + +`http {{example.org}} {{name='bob'}} {{age:=29}} {{married:=false}} hobbies:='["http", "pies"]`