1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-28 08:38:44 +02:00

Updated documentation for query string params.

This commit is contained in:
Jake Basile 2012-07-18 21:16:33 -05:00
parent 24d6331d15
commit 76a3125153
2 changed files with 15 additions and 4 deletions

View File

@ -54,7 +54,7 @@ Synopsis::
http [flags] [METHOD] URL [items]
There are four types of key-value pair items available:
There are five types of key-value pair items available:
Headers (``Name:Value``)
Arbitrary HTTP headers. The ``:`` character is used to separate a header's
@ -77,6 +77,9 @@ File fields (``field@/path/to/file``)
``screenshot@/path/to/file.png``. The presence of a file field results into
a ``multipart/form-data`` request.
Query String Parameters (``name=:value``)
Appends the given name/value pair as a query string to the URL.
Examples
^^^^^^^^
@ -118,6 +121,12 @@ The above will send the same request as if the following HTML form were submitte
<input type="file" name="cv" />
</form>
Query string parameters can be added to any request::
http GET example.com/ search=:donuts
Will GET the URL "example.com/?search=donuts".
A whole request body can be passed in via **``stdin``** instead, in which
case it will be used with no further processing::
@ -172,8 +181,9 @@ See ``http -h`` for more details::
include one.
ITEM A key-value pair whose type is defined by the
separator used. It can be an HTTP header
(header:value), a data field to be used in the request
body (field_name=value), a raw JSON data field
(header:value), a query parameter (name=:value),
a data field to be used in the request body
(field_name=value), a raw JSON data field
(field_name:=value), or a file field
(field_name@/path/to/file). You can use a backslash to
escape a colliding separator in the field name.

View File

@ -212,7 +212,8 @@ parser.add_argument(
A key-value pair whose type is defined by the
separator used. It can be an HTTP header (header:value),
a data field to be used in the request body (field_name=value),
a raw JSON data field (field_name:=value),
a raw JSON data field (field_name:=value),
a query parameter (name=:value),
or a file field (field_name@/path/to/file).
You can use a backslash to escape a colliding
separator in the field name.