From 1d062a94f05793e921deb603ed44208dc5841765 Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Sun, 28 Feb 2016 18:17:45 +0800 Subject: [PATCH 1/4] 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 0000000000..3203b37996 --- /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/4] 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 3203b37996..8578a5a403 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/4] Commands-- --- pages/common/http.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pages/common/http.md b/pages/common/http.md index 8578a5a403..ca7ef4efab 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` From 30433c622bf590c14e138e752e5712227700cc82 Mon Sep 17 00:00:00 2001 From: Igor Shubovych Date: Mon, 29 Feb 2016 11:47:42 +0200 Subject: [PATCH 4/4] http: add the missing example to HTTPie (see discussion in #808) --- pages/common/http.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/common/http.md b/pages/common/http.md index ca7ef4efab..8578a5a403 100644 --- a/pages/common/http.md +++ b/pages/common/http.md @@ -25,3 +25,7 @@ - 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`