Refactor send_request in client.rs (#13701)

Closes #13687
Closes #13686

# Description
Light refactoring of `send_request `in `client.rs`. In the end there are
more lines but now the logic is more concise and facilitates adding new
conditions in the future. Unit tests ran fine and I tested a few cases
manually.
Cool project btw, I'll be using nushell from now on.
This commit is contained in:
xonas
2024-09-04 18:05:39 -03:00
committed by GitHub
parent 63b94dbd28
commit 4792328d0e
3 changed files with 203 additions and 123 deletions

View File

@ -639,6 +639,15 @@ pub enum ShellError {
span: Span,
},
/// An unsupported body input was used for the respective application body type in 'http' command
///
/// ## Resolution
///
/// This error is fairly generic. Refer to the specific error message for further details.
#[error("Unsupported body for current content type")]
#[diagnostic(code(nu::shell::unsupported_body), help("{msg}"))]
UnsupportedHttpBody { msg: String },
/// An operation was attempted with an input unsupported for some reason.
///
/// ## Resolution