-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Create the following Spin SDK P3 handler:
#[spin_sdk::http_wasip3::http_service]
async fn handle(_request: Request) -> impl IntoResponse {
spin_sdk::http_wasip3::Response::new("done\n")
}Rust gets mad at you:
Scroll down the docs to see what you are allowed to pass to new and:
It's confusing that the docs show an example of passing an &str but you're not actually allowed to. Unfortunately the Response type is a re-export so we don't control the docs.
Amusingly, you can return an &str directly...
#[spin_sdk::http_wasip3::http_service]
async fn handle(_request: Request) -> impl IntoResponse {
"done\n"
}
...you just can't use one in a Response.
Metadata
Metadata
Assignees
Labels
No labels