diff --git a/README.rst b/README.rst index 1c08542e..128dcf67 100644 --- a/README.rst +++ b/README.rst @@ -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 +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. diff --git a/httpie/cli.py b/httpie/cli.py index 3449bf63..b152f0ad 100644 --- a/httpie/cli.py +++ b/httpie/cli.py @@ -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.