forked from extern/httpie-cli
Updated documentation for query string params.
This commit is contained in:
parent
24d6331d15
commit
76a3125153
16
README.rst
16
README.rst
@ -54,7 +54,7 @@ Synopsis::
|
|||||||
|
|
||||||
http [flags] [METHOD] URL [items]
|
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``)
|
Headers (``Name:Value``)
|
||||||
Arbitrary HTTP headers. The ``:`` character is used to separate a header's
|
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
|
``screenshot@/path/to/file.png``. The presence of a file field results into
|
||||||
a ``multipart/form-data`` request.
|
a ``multipart/form-data`` request.
|
||||||
|
|
||||||
|
Query String Parameters (``name=:value``)
|
||||||
|
Appends the given name/value pair as a query string to the URL.
|
||||||
|
|
||||||
|
|
||||||
Examples
|
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" />
|
<input type="file" name="cv" />
|
||||||
</form>
|
</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
|
A whole request body can be passed in via **``stdin``** instead, in which
|
||||||
case it will be used with no further processing::
|
case it will be used with no further processing::
|
||||||
|
|
||||||
@ -172,8 +181,9 @@ See ``http -h`` for more details::
|
|||||||
include one.
|
include one.
|
||||||
ITEM A key-value pair whose type is defined by the
|
ITEM A key-value pair whose type is defined by the
|
||||||
separator used. It can be an HTTP header
|
separator used. It can be an HTTP header
|
||||||
(header:value), a data field to be used in the request
|
(header:value), a query parameter (name=:value),
|
||||||
body (field_name=value), a raw JSON data field
|
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:=value), or a file field
|
||||||
(field_name@/path/to/file). You can use a backslash to
|
(field_name@/path/to/file). You can use a backslash to
|
||||||
escape a colliding separator in the field name.
|
escape a colliding separator in the field name.
|
||||||
|
@ -213,6 +213,7 @@ parser.add_argument(
|
|||||||
separator used. It can be an HTTP header (header:value),
|
separator used. It can be an HTTP header (header:value),
|
||||||
a data field to be used in the request body (field_name=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).
|
or a file field (field_name@/path/to/file).
|
||||||
You can use a backslash to escape a colliding
|
You can use a backslash to escape a colliding
|
||||||
separator in the field name.
|
separator in the field name.
|
||||||
|
Loading…
Reference in New Issue
Block a user