diff --git a/crates/nu-command/src/network/http/client.rs b/crates/nu-command/src/network/http/client.rs index 5f65f08b96..8d6d5e8958 100644 --- a/crates/nu-command/src/network/http/client.rs +++ b/crates/nu-command/src/network/http/client.rs @@ -170,6 +170,10 @@ pub fn send_request( Box::new(move || request.send_bytes(&val)), ctrl_c, ), + Value::String { .. } if body_type == BodyType::Json => { + let data = value_to_json_value(&body)?; + send_cancellable_request(&request_url, Box::new(|| request.send_json(data)), ctrl_c) + } Value::String { val, .. } => send_cancellable_request( &request_url, Box::new(move || request.send_string(&val)),