Expand description
§golem-wasi-http
An HTTP client library that uses WASI HTTP (WebAssembly System Interface) as its backend.
The library provides a convenient API for making HTTP requests from WASM components. It supports both async and synchronous operations, with optional support for JSON and multipart forms.
Originally started as a fork of the reqwest library but diverged significantly and dropped all the non WASI-HTTP backends.
§Features
- Async and blocking Clients
- Plain bodies, JSON, form data, and multipart support
- Custom request/response body handling
§Optional Features
The following are a list of [Cargo features][cargo-features] that can be enabled or disabled:
- async: Async client API using the wstd crate
- json: Provides serialization and deserialization for JSON bodies.
- multipart: Provides functionality for multipart forms.
Modules§
- header
- HTTP header types
Structs§
- Body
- An asynchronous request body.
- Client
- A
Clientto make Requests with. - Client
Builder - A
ClientBuildercan be used to create aClientwith custom configuration. - Error
- The Errors that may occur when processing a
Request. - Incoming
Body - Represents an incoming HTTP Request or Response’s Body.
- Input
Stream - An input bytestream.
- Method
- The Request Method (VERB)
- Request
- A request which can be executed with
Client::execute(). - Request
Builder - A builder to construct the properties of a
Request. - Response
- A Response to a submitted
Request. - Status
Code - An HTTP status code (
status-codein RFC 9110 et al.). - Url
- A parsed URL record.
- Version
- Represents a version of the HTTP spec.
Enums§
- Stream
Error - An error for input-stream and output-stream operations.
Traits§
- IntoUrl
- A trait to try to convert some type into a
Url. - Response
Builder Ext - Extension trait for http::response::Builder objects
Type Aliases§
- Result
- A
Resultalias where theErrcase iscrate::Error.