mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Merge branch 'master' into fetch_post
This commit is contained in:
@ -122,7 +122,7 @@ pub async fn post(
|
||||
body: &Value,
|
||||
user: Option<String>,
|
||||
password: Option<String>,
|
||||
headers: &Vec<HeaderKind>,
|
||||
headers: &[HeaderKind],
|
||||
tag: Tag,
|
||||
) -> Result<(Option<String>, UntaggedValue, Tag), ShellError> {
|
||||
if location.starts_with("http:") || location.starts_with("https:") {
|
||||
@ -311,20 +311,18 @@ pub async fn post(
|
||||
}
|
||||
None => Ok((
|
||||
None,
|
||||
UntaggedValue::string(format!("No content type found")),
|
||||
UntaggedValue::string("No content type found".to_owned()),
|
||||
Tag {
|
||||
anchor: Some(AnchorLocation::Url(location.to_string())),
|
||||
span: tag.span,
|
||||
},
|
||||
)),
|
||||
},
|
||||
Err(_) => {
|
||||
return Err(ShellError::labeled_error(
|
||||
"URL could not be opened",
|
||||
"url not found",
|
||||
tag,
|
||||
));
|
||||
}
|
||||
Err(_) => Err(ShellError::labeled_error(
|
||||
"URL could not be opened",
|
||||
"url not found",
|
||||
tag,
|
||||
)),
|
||||
}
|
||||
} else {
|
||||
Err(ShellError::labeled_error(
|
||||
|
Reference in New Issue
Block a user