Crate golem_wasi_http

Crate golem_wasi_http 

Source
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 Client to make Requests with.
ClientBuilder
A ClientBuilder can be used to create a Client with custom configuration.
Error
The Errors that may occur when processing a Request.
IncomingBody
Represents an incoming HTTP Request or Response’s Body.
InputStream
An input bytestream.
Method
The Request Method (VERB)
Request
A request which can be executed with Client::execute().
RequestBuilder
A builder to construct the properties of a Request.
Response
A Response to a submitted Request.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
Url
A parsed URL record.
Version
Represents a version of the HTTP spec.

Enums§

StreamError
An error for input-stream and output-stream operations.

Traits§

IntoUrl
A trait to try to convert some type into a Url.
ResponseBuilderExt
Extension trait for http::response::Builder objects

Type Aliases§

Result
A Result alias where the Err case is crate::Error.