Skip to content

Rust SDK: add friendly constructor/builder for OutgoingRequest #24

@itowlson

Description

@itowlson

Per https://github.com/fermyon/spin/blob/b45feb8e91afe5625a2de19e1904eec10ebbc936/examples/wasi-http-rust-streaming-outgoing-body/src/lib.rs#L99:

    let outbound_req = spin_sdk::http::OutgoingRequest::new(
        &spin_sdk::http::Method::Get,
        None,
        Some(&spin_sdk::http::Scheme::Https),
        Some("dioxus-test-ninaynoi.fermyon.app"),
        &spin_sdk::http::Fields::new(&[]),
    );

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions