async_client: Add the content-type header to our requests.
parent
ee290add45
commit
61f3da3161
|
@ -576,11 +576,17 @@ impl AsyncClient {
|
||||||
HttpMethod::GET => self.http_client.get(url),
|
HttpMethod::GET => self.http_client.get(url),
|
||||||
HttpMethod::POST => {
|
HttpMethod::POST => {
|
||||||
let body = request.body().clone();
|
let body = request.body().clone();
|
||||||
self.http_client.post(url).body(body)
|
self.http_client
|
||||||
|
.post(url)
|
||||||
|
.body(body)
|
||||||
|
.header(reqwest::header::CONTENT_TYPE, "application/json")
|
||||||
}
|
}
|
||||||
HttpMethod::PUT => {
|
HttpMethod::PUT => {
|
||||||
let body = request.body().clone();
|
let body = request.body().clone();
|
||||||
self.http_client.put(url).body(body)
|
self.http_client
|
||||||
|
.put(url)
|
||||||
|
.body(body)
|
||||||
|
.header(reqwest::header::CONTENT_TYPE, "application/json")
|
||||||
}
|
}
|
||||||
HttpMethod::DELETE => unimplemented!(),
|
HttpMethod::DELETE => unimplemented!(),
|
||||||
_ => panic!("Unsuported method"),
|
_ => panic!("Unsuported method"),
|
||||||
|
|
Loading…
Reference in New Issue