Minor changes to simple example to get rid of warnings and error.

This commit is contained in:
robviren
2021-01-02 07:35:42 -06:00
committed by Martin Algesten
parent 1f0d84279a
commit 7ffaa8cf9a

View File

@@ -25,11 +25,14 @@ Version 2.0.0 was released recently and changed some APIs. See the [changelog] f
In its simplest form, ureq looks like this: In its simplest form, ureq looks like this:
```rust ```rust
use ureq;
fn main() -> Result<(), ureq::Error> { fn main() -> Result<(), ureq::Error> {
let body: String = ureq::get("http://example.com") let body: String = ureq::get("http://example.com")
.set("Example-Header", "header value") .set("Example-Header", "header value")
.call()? .call()
.into_string()?; .into_string()?;
println!("{:#?}",body);
Ok(()) Ok(())
} }
``` ```