Setting queries with surf

I am attempting surf::get request with some headers and two queries of the form: ?instruments="..."&includeHomeConversions=False

The code is (... is for confidential data not included here) :

#[derive(Serialize, Deserialize)]
struct Query {
instruments: &'static str,
includeHomeConversions: bool }

async fn gethtprice() -> Result<(DatStruct), surf::Exception> {

let query = Query { 
	instruments: "EUR_USD",
	includeHomeConversions: false };

let mut price:PriceStruct = surf::get("https:...")
	.set_header("Content-Type", "application/json")
	.set_header("Authorization", "....")
	.set_query(&query)?
	.recv_json().await?;

But price always comes back empty. When I use bash wget, where the queries are included in one long string, and then read the result with serde_json, then it works. This is however a roundabout way of having to rely on external utilities...

Why these complications with setting queries via an extraneous struct?
Could it be that Rust boolean value is "false", whereas the query needed is "False"?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.