Hi, I'm trying to perform a Http Get Request but am encountering an error at Ok(mut response) and Err(_) => println!("Could not make the request!") saying it's expecting a std::future:Future but is getting an enum:result:Result. I'm not sure what future:Future is or what qualifies for it in the given context.
Thanks in advance.
fn get()
{
match reqwest::get("http://localhost:8088")
{
Ok(mut response) =>
{
if response.status == reqwest::StatusCode::OK
{
match response.text()
{
Ok(text) => println!("Response Text: {}", text),
Err(_) => println!("Could not read response text!")
}
}
else
{
println!("Response was not 200 Ok.");
}
}
Err(_) => println!("Could not make the request!")
}
}