Module http

Source
Expand description

Helpers for building Spin wasi-http components.

Modules§

conversions
Traits for converting between the various types
responses
Helper functions for creating responses

Macros§

http_router
A macro to help with constructing a Router from a stream of tokens.

Structs§

Body
A Body extractor
Fields
This following block defines the fields resource which corresponds to HTTP standard Fields. Fields are a common representation used for both Headers and Trailers.
HeaderValue
A header value.
IncomingRequest
Represents an incoming HTTP Request.
IncomingResponse
Represents an incoming HTTP Response.
Json
A Json extractor
JsonBodyError
An error parsing a JSON body
NonUtf8BodyError
An error when the body is not UTF-8
OutgoingBody
Represents an outgoing HTTP Request or Response’s Body.
OutgoingRequest
Represents an outgoing HTTP Request.
OutgoingResponse
Represents an outgoing HTTP Response.
Request
A unified request object that can represent both incoming and outgoing requests.
RequestBuilder
A request builder
Response
A unified response object that can represent both outgoing and incoming responses.
ResponseBuilder
A builder for `Response``
ResponseOutparam
The out param for setting an OutgoingResponse
Router
Exports HTTP Router items. The Spin SDK HTTP router.

Enums§

ErrorCode
These cases are inspired by the IANA HTTP Proxy Error Types: https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types
Method
This type corresponds to HTTP standard Methods.
Scheme
This type corresponds to HTTP standard Related Schemes.
SendError
An error encountered when performing an HTTP request

Traits§

Handler
Exports HTTP Router items. An HTTP request handler.
IntoResponse
A trait for any type that can be turned into a Response

Functions§

send
Send an outgoing request

Type Aliases§

Headers
Headers is an alias for Fields.
Params
Exports HTTP Router items. Route parameters extracted from a URI that match a route pattern.
StatusCode
This type corresponds to the HTTP standard Status Code.
Trailers
Trailers is an alias for Fields.