mirror of
https://github.com/nushell/nushell.git
synced 2025-07-08 18:37:07 +02:00
Hello, this PR resolves the second request of the issue https://github.com/nushell/nushell/issues/10957, which involves using a default verb based on the request. If a URL is provided, the command will default to GET, and if data is provided, it will default to POST. This means that the following pairs of commands are equivalent: ``` http --content-type application/json http://localhost:8000 {a:1} http post --content-type application/json http://localhost:8000 {a:1} ``` ``` http http://localhost:8000 "username" http post http://localhost:8000 "username" ``` ``` http http://localhost:8000 http get http://localhost:8000 ``` The `http` command now accepts all flags of the `post` and `get` commands. It will still display the help message if no subcommand is provided, and the description has been updated accordingly. The logic in the `http` command is minimal to delegate error management responsibilities to the specific `run_get` and `run_post` functions.
This crate contains the majority of our commands
We allow ourselves to move some of the commands in nu-command
to nu-cmd-*
crates as needed.
Internal Nushell crate
This crate implements components of Nushell and is not designed to support plugin authors or other users directly.