Set content type header

This commit is contained in:
Jonas Zeunert
2024-04-22 23:23:26 +02:00
parent 8f79bca6f0
commit 1dad012c23

View File

@@ -45,8 +45,14 @@ impl ElasticQuery {
let query = serde_json::to_string(self).unwrap();
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);
Ok(serde_json::from_str(&response)?)
}
}