From b62473aa25c3e56d90722556aa2787fae72eec73 Mon Sep 17 00:00:00 2001 From: Max Xu Date: Wed, 20 Dec 2017 11:51:32 +0800 Subject: [PATCH 1/4] httpie.md: add page --- pages/linux/httpie.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 pages/linux/httpie.md diff --git a/pages/linux/httpie.md b/pages/linux/httpie.md new file mode 100644 index 000000000..1f560cd2e --- /dev/null +++ b/pages/linux/httpie.md @@ -0,0 +1,31 @@ +# httpie + +> A human-friendly CLI HTTP tool. + +- GET method (default method with no request data): + +`http {{https://api.github.com/users}}` + +- POST method (default method with request data): + +`http {{example.org}} {{hello=World}}` + +- POST method with redirected input: + +`http {{example.org}} < {{file.json}}` + +- PUT method: + +`http PUT {{httpbin.org/put}} {{API-Key:foo hello=world}}` + +- DELETE method: + +`http DELETE {{example.org/todos/7}}` + +- Show the whole HTTP exchange (request and response): + +`http -v {{example.org}}` + +- Download file: + +`http --download {{example.org}}` From 9c2826882981b6c5a0970d135c44866c5a1533c6 Mon Sep 17 00:00:00 2001 From: Max Xu Date: Wed, 20 Dec 2017 20:27:08 +0800 Subject: [PATCH 2/4] Update httpie.md --- pages/linux/httpie.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/linux/httpie.md b/pages/linux/httpie.md index 1f560cd2e..0fed4fc88 100644 --- a/pages/linux/httpie.md +++ b/pages/linux/httpie.md @@ -2,30 +2,30 @@ > A human-friendly CLI HTTP tool. -- GET method (default method with no request data): +- Send a GET request (default method with no request data): `http {{https://api.github.com/users}}` -- POST method (default method with request data): +- Send a POST request (default method with request data): `http {{example.org}} {{hello=World}}` -- POST method with redirected input: +- Send a POST request with redirected input: `http {{example.org}} < {{file.json}}` -- PUT method: +- Send a PUT request: `http PUT {{httpbin.org/put}} {{API-Key:foo hello=world}}` -- DELETE method: +- Send a DELETE request: `http DELETE {{example.org/todos/7}}` -- Show the whole HTTP exchange (request and response): +- Show the whole HTTP exchange (both request and response): `http -v {{example.org}}` -- Download file: +- Download a file: `http --download {{example.org}}` From 5a6a7135141f67700bed141cfcb1e2e47afc67fc Mon Sep 17 00:00:00 2001 From: Max Xu Date: Fri, 22 Dec 2017 11:00:30 +0800 Subject: [PATCH 3/4] Update httpie.md --- pages/linux/httpie.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/linux/httpie.md b/pages/linux/httpie.md index 0fed4fc88..6edf41962 100644 --- a/pages/linux/httpie.md +++ b/pages/linux/httpie.md @@ -1,6 +1,6 @@ # httpie -> A human-friendly CLI HTTP tool. +> A user friendly command line HTTP tool. - Send a GET request (default method with no request data): @@ -14,13 +14,13 @@ `http {{example.org}} < {{file.json}}` -- Send a PUT request: +- Send a PUT request with a given json body: -`http PUT {{httpbin.org/put}} {{API-Key:foo hello=world}}` +`http PUT {{httpbin.org/put}} {{hello=world}}` -- Send a DELETE request: +- Send a DELETE request with a giben header: -`http DELETE {{example.org/todos/7}}` +`http DELETE {{example.org/todos/7}} {{API-Key:foo}}` - Show the whole HTTP exchange (both request and response): From b60842e5a999622e3c28b741ec766e6cb6cedd1b Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Fri, 22 Dec 2017 09:27:22 +0530 Subject: [PATCH 4/4] http: update to example.com And also fix a minor typo --- pages/linux/httpie.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/linux/httpie.md b/pages/linux/httpie.md index 6edf41962..e5791c8cd 100644 --- a/pages/linux/httpie.md +++ b/pages/linux/httpie.md @@ -4,28 +4,28 @@ - Send a GET request (default method with no request data): -`http {{https://api.github.com/users}}` +`http {{https://example.com}}` - Send a POST request (default method with request data): -`http {{example.org}} {{hello=World}}` +`http {{https://example.com}} {{hello=World}}` - Send a POST request with redirected input: -`http {{example.org}} < {{file.json}}` +`http {{https://example.com}} < {{file.json}}` - Send a PUT request with a given json body: -`http PUT {{httpbin.org/put}} {{hello=world}}` +`http PUT {{https://example.com/todos/7}} {{hello=world}}` -- Send a DELETE request with a giben header: +- Send a DELETE request with a given request header: -`http DELETE {{example.org/todos/7}} {{API-Key:foo}}` +`http DELETE {{https://example.com/todos/7}} {{API-Key:foo}}` - Show the whole HTTP exchange (both request and response): -`http -v {{example.org}}` +`http -v {{https://example.com}}` - Download a file: -`http --download {{example.org}}` +`http --download {{https://example.com}}`