Skip to content

Simplified the httpcli options #582

@bertysentry

Description

@bertysentry

Use Case

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.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions