Skip to main content

Module http

Module http 

Source
Expand description

Outgoing HTTP over WASI HTTP p3, using standard Rust HTTP request builders.

Requests have buffered byte bodies; responses can be streamed or collected. HTTP error statuses are responses, not transport errors. There are no automatic redirects or retries. Sending requires the WASI p3 runtime used by Golem agents.

Modules§

header
HTTP header types

Structs§

HeaderMap
A specialized multimap for header names and values.
HeaderValue
Represents an HTTP header field value.
Method
The Request Method (VERB)
Request
Represents an HTTP request.
RequestOptionsExtension
A wrapper around types::RequestOptions that implements Clone
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
Uri
The URI component of a request.

Enums§

Error
Failures sending a request or reading and decoding its response body.

Functions§

response_bytes
Collect the remaining body in memory, including checking its final result. For large bodies, stream frames from response.into_body() instead.
response_json
Collect the remaining body in memory and decode JSON, regardless of status.
response_text
Collect the remaining body in memory and decode it as strict UTF-8.
send
Send a request, checking both upload and request transmission completion.

Type Aliases§

IncomingResponseBody
The body type used for incoming HTTP responses.
Response
A type alias for an HTTP response with a customizable body type.