You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use httpcli just like cURL or wget, without having to type --method and --url.
Suggested Change
httpcli [GET|POST|PUT|HEAD] <url> [OPTIONS]
If no method is specified, GET is assumed.
--method is still allowed to specify a rare method (example: --method PATCH).
If main arguments are provided (with no dashes):
First argument is the method if it's GET|POST|PUT|HEAD. If not among these values, then method GET is assumed, and first argument is considered as the URL
Second argument is the URL
If the URL doesn't start with http:// or https://, add https://.
If a method is specified as a main argument, and if the --method option is specified, the --method value overrides the main argument: httpcli POST https://server/login --method PATCH will use PATCH.
Same for URL: httpcli https://server/login --url https://server/info will request https://server/info.
The text was updated successfully, but these errors were encountered:
* Simplified httpcli options by adding two parameters `positionalMethod` and `positionalUrl` which allow to create CLI requests without using `--method` and `--url`.
* Handled all the possible cases when the user specifies both positional parameters and options.
* Tested on MetricsHub.
Use Case
I want to use
httpcli
just like cURL orwget
, without having to type--method
and--url
.Suggested Change
If no method is specified,
GET
is assumed.--method
is still allowed to specify a rare method (example:--method PATCH
).If main arguments are provided (with no dashes):
If the URL doesn't start with
http://
orhttps://
, addhttps://
.If a method is specified as a main argument, and if the
--method
option is specified, the--method
value overrides the main argument:httpcli POST https://server/login --method PATCH
will usePATCH
.Same for URL:
httpcli https://server/login --url https://server/info
will requesthttps://server/info
.The text was updated successfully, but these errors were encountered: