From 1d062a94f05793e921deb603ed44208dc5841765 Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Sun, 28 Feb 2016 18:17:45 +0800 Subject: [PATCH 1/3] 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"]` From 927e44ca261eb542f400cfc478d5b60020296809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Rozto=C4=8Dil?= Date: Mon, 29 Feb 2016 01:22:04 +0800 Subject: [PATCH 2/3] Reduced the number of examples --- pages/common/http.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pages/common/http.md b/pages/common/http.md index 3203b3799..8578a5a40 100644 --- a/pages/common/http.md +++ b/pages/common/http.md @@ -29,11 +29,3 @@ - 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"]` From 9179bb7131d6f4723ecb050d4821d138e7ef6df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Rozto=C4=8Dil?= Date: Mon, 29 Feb 2016 14:26:07 +0800 Subject: [PATCH 3/3] Commands-- --- pages/common/http.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pages/common/http.md b/pages/common/http.md index 8578a5a40..ca7ef4efa 100644 --- a/pages/common/http.md +++ b/pages/common/http.md @@ -25,7 +25,3 @@ - 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`