Replies: 2 comments 8 replies
-
|
I found this that looks more current but also horribly contrived: Is that really the way to do this? |
Beta Was this translation helpful? Give feedback.
6 replies
-
|
Use the async version works: #[get("/sparks")]
async fn sparks() -> Json<Vec<Spark>> {
let response = reqwest::get("https://www.google.com").await.unwrap().text().await.unwrap();
//...
}I got the same error as you when i used the blocking feature. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I found one example of how to do this but that seems to be outdated and does not compile: https://www.shawntabrizi.com/code/combining-rocket-with-reqwest-to-call-an-api-with-rust/
Does anybody have something current?
I have:
but that also does not compile. (A common thread.)
Beta Was this translation helpful? Give feedback.
All reactions