From e7dc59e0dbcee5ebb584cfa053a89404b2b9778f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Roztoc=CC=8Cil?= Date: Sat, 25 Feb 2012 13:47:23 +0100 Subject: [PATCH] Updated README. --- README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b7c06ccb..ff1eaf8b 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,31 @@ HTTPie is a CLI frontend for [python-requests](python-requests.org). pip install httpie +### Usage + + httpie [flags] METHOD [header:value data-field-name=value]* URL + +The default request `Content-Type` in `application/json` and data fields are automatically serialized as a JSON `Object`: + + httpie PATCH name=John api.example.com/person/1 + +That will issue the following request: + + PATCH /person/1 HTTP/1.1 + User-Agent: HTTPie/0.1 + X-API-Token: 123 + Content-Type: application/json; charset=utf-8 + + {"name": "John"} + + +The data to be sent can also be passed via `stdin`: + + httpie PUT X-API-Token:123 api.example.com/person/1 < person.json + +The flags mirror many of the arguments you would use with `requests.request`. See `httpie -h` for more details. + + ### Screenshot ![httpie](https://github.com/jkbr/httpie/raw/master/httpie.png) - -