Set content type header
This commit is contained in:
@@ -45,8 +45,14 @@ impl ElasticQuery {
|
|||||||
let query = serde_json::to_string(self).unwrap();
|
let query = serde_json::to_string(self).unwrap();
|
||||||
|
|
||||||
let client = reqwest::blocking::Client::new();
|
let client = reqwest::blocking::Client::new();
|
||||||
let response = client.get(url).body(query).send()?.text()?;
|
let response = client
|
||||||
|
.get(url)
|
||||||
|
.header("Content-Type", "application/json")
|
||||||
|
.body(query)
|
||||||
|
.send()?
|
||||||
|
.text()?;
|
||||||
debug!("Elastic Response:\n {:?}", response);
|
debug!("Elastic Response:\n {:?}", response);
|
||||||
|
|
||||||
Ok(serde_json::from_str(&response)?)
|
Ok(serde_json::from_str(&response)?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user