Module spin_sdk.wit.imports.wasi_http_outgoing_handler_0_2_0
This interface defines a handler of outgoing HTTP Requests. It should be imported by components which wish to make HTTP Requests.
Functions
def handle(request: OutgoingRequest,
options: RequestOptions | None) ‑> FutureIncomingResponse-
Expand source code
def handle(request: wasi_http_types_0_2_0.OutgoingRequest, options: Optional[wasi_http_types_0_2_0.RequestOptions]) -> wasi_http_types_0_2_0.FutureIncomingResponse: """ This function is invoked with an outgoing HTTP Request, and it returns a resource `future-incoming-response` which represents an HTTP Response which may arrive in the future. The `options` argument accepts optional parameters for the HTTP protocol's transport layer. This function may return an error if the `outgoing-request` is invalid or not allowed to be made. Otherwise, protocol errors are reported through the `future-incoming-response`. Raises: `componentize_py_types.Err(spin_sdk.wit.imports.wasi_http_types_0_2_0.ErrorCode)` """ raise NotImplementedErrorThis function is invoked with an outgoing HTTP Request, and it returns a resource
future-incoming-responsewhich represents an HTTP Response which may arrive in the future.The
optionsargument accepts optional parameters for the HTTP protocol's transport layer.This function may return an error if the
outgoing-requestis invalid or not allowed to be made. Otherwise, protocol errors are reported through thefuture-incoming-response.Raises:
componentize_py_types.Err(ErrorCode)