Issue #54 Method suggestion proposal

This commit is contained in:
Vladimir Berkutov 2012-06-17 22:11:26 +04:00
parent bca36f0464
commit d920f20847
3 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ Most of the flags mirror the arguments understood by ``requests.request``. See `
[--style STYLE] [--auth AUTH] [--auth-type {basic,digest}] [--style STYLE] [--auth AUTH] [--auth-type {basic,digest}]
[--verify VERIFY] [--proxy PROXY] [--allow-redirects] [--verify VERIFY] [--proxy PROXY] [--allow-redirects]
[--timeout TIMEOUT] [--timeout TIMEOUT]
METHOD URL [ITEM [ITEM ...]] [METHOD] URL [ITEM [ITEM ...]]
HTTPie - cURL for humans. <http://httpie.org> HTTPie - cURL for humans. <http://httpie.org>
@ -117,7 +117,7 @@ Most of the flags mirror the arguments understood by ``requests.request``. See `
METHOD The HTTP method to be used for the request (GET, POST, METHOD The HTTP method to be used for the request (GET, POST,
PUT, DELETE, PATCH, ...). If this argument is omitted PUT, DELETE, PATCH, ...). If this argument is omitted
then httpie will guess HTTP method. If there is either then httpie will guess HTTP method. If there is either
form data field or JSON data field or file field simple data field or JSON data field or file field
presents then method is POST otherwise it is GET. presents then method is POST otherwise it is GET.
URL The protocol defaults to http:// if the URL does not URL The protocol defaults to http:// if the URL does not
include one. include one.

View File

@ -177,7 +177,7 @@ parser.add_argument(
The HTTP method to be used for the request The HTTP method to be used for the request
(GET, POST, PUT, DELETE, PATCH, ...). (GET, POST, PUT, DELETE, PATCH, ...).
If this argument is omitted then httpie will guess HTTP method. If this argument is omitted then httpie will guess HTTP method.
If there is either form data field or JSON data field If there is either form simple field or JSON data field
or file field presents then method is POST otherwise it is GET. or file field presents then method is POST otherwise it is GET.
''') ''')
) )

View File

@ -55,7 +55,7 @@ class HTTPieArgumentParser(argparse.ArgumentParser):
"""Suggests HTTP method by positional argument values. """Suggests HTTP method by positional argument values.
In following description by data item it means one of: In following description by data item it means one of:
* form data item (key=value) * simple data item (key=value)
* JSON raw item (key:=value) * JSON raw item (key:=value)
* file item (key@value) * file item (key@value)