diff --git a/kits/rust/src/bindings.rs b/kits/rust/src/bindings.rs index 94675834..a01f97a1 100644 --- a/kits/rust/src/bindings.rs +++ b/kits/rust/src/bindings.rs @@ -24,7 +24,10 @@ impl From for Response> { } } -pub fn send_http_request(req: Request) -> Result>, HttpRequestError> { +pub fn send_http_request(req: Request) -> Result>, HttpRequestError> +where + T: Into>, +{ let method = match *req.method() { Method::GET => HttpMethod::Get, Method::POST => HttpMethod::Get, @@ -50,10 +53,10 @@ pub fn send_http_request(req: Request) -> Result>, Http .collect::>(); let uri = req.uri().to_string(); - let body = req.into_body(); + let body: Vec = req.into_body().into(); let request = HttpRequest { - body: Some(body.as_bytes()), + body: Some(body.as_slice()), headers: &headers_slice, method, params: &[],