Module spin_sdk.wit.imports.wasi_http_client_0_3_0

This interface defines an HTTP client for sending "outgoing" requests.

Most components are expected to import this interface to provide the capability to send HTTP requests to arbitrary destinations on a network.

The type signature of client.send is the same as handler.handle. This duplication is currently necessary because some Component Model tooling (including WIT itself) is unable to represent a component importing two instances of the same interface. A client.send import may be linked directly to a handler.handle export to bypass the network.

Functions

async def send(request: Request) ‑> Response
Expand source code
async def send(request: wasi_http_types_0_3_0.Request) -> wasi_http_types_0_3_0.Response:
    """
    This function may be used to either send an outgoing request over the
    network or to forward it to another component.
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.wasi_http_types_0_3_0.ErrorCode)`
    """
    raise NotImplementedError

This function may be used to either send an outgoing request over the network or to forward it to another component.

Raises: componentize_py_types.Err(ErrorCode)