Fix http body encoding (#1962)

This commit is contained in:
hchockarprasad 2023-05-10 18:14:42 +05:30 committed by GitHub
parent f1ef3bfd21
commit 3140e06ad2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ pub(crate) fn uri_is_valid(uri: &str) -> bool {
fn encode_body(req: RequestBuilder, body: Value) -> RequestBuilder {
match body {
Value::Bytes(bytes) => req.header(CONTENT_TYPE, "application/octet-stream").body(bytes.0),
_ if body.is_some() => req.json(&body),
_ if body.is_some() => req.json(&body.into_json()),
_ => req,
}
}