-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust SDK: add friendly constructor/builder for OutgoingRequest
#24
Comments
use spin_sdk::http::Request;
let resp: Response = spin_sdk::http::send(Request::get(
"https://random-data-api.fermyon.app/animals/json",
)).await?; |
@lann I might be misunderstanding - we already had builders for |
Ah no the linked PR doesn't help with streaming request bodies. The example you linked just streams the response body, and I think you can mix-n-match a non-streaming |
I'm not explaining myself very well I fear.
I linked the example to try illustrate the third item not the first one, and was trying to clarify if fermyon/spin#1977 helps with said third one. My mention of streaming was only to explain why I (thought I) needed an Sorry for the confusion. |
Per https://github.com/fermyon/spin/blob/b45feb8e91afe5625a2de19e1904eec10ebbc936/examples/wasi-http-rust-streaming-outgoing-body/src/lib.rs#L99:
Could we add a constructor or builder that takes a URL, and maybe a Method instead of &Method? It feels a bit unwieldy right now (though users can always create their own wrappers).
The text was updated successfully, but these errors were encountered: