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
- A common representation for headers and trailers.
- Header
Value - A header value.
- Incoming
Request - Represents an incoming HTTP request.
- Incoming
Response - Represents an incoming HTTP Response.
- Json
- A Json extractor
- Json
Body Error - An error parsing a JSON body
- NonUtf8
Body Error - An error when the body is not UTF-8
- Outgoing
Body - Represents an outgoing HTTP Request or Response’s Body.
- Outgoing
Request - Represents an outgoing HTTP Request.
- Outgoing
Response - Represents an outgoing HTTP response.
- Request
- A unified request object that can represent both incoming and outgoing requests.
- Request
Builder - A builder for non-streaming outgoing HTTP requests. You can obtain a RequestBuilder from the Request::builder() method, or from method-specific helpers such as Request::get() or Request::post().
- Response
- A unified response object that can represent both outgoing and incoming responses.
- Response
Builder - A builder for `Response``
- Response
Outparam - A parameter provided by Spin for setting a streaming OutgoingResponse.
- Router
- Routes HTTP requests within a Spin component.
Enums§
- Error
Code - 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.
- Send
Error - An error encountered when performing an HTTP request
Traits§
- Handler
- An HTTP request handler.
- Into
Response - 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
- Route parameters extracted from a URI that match a route pattern.
- Status
Code - This type corresponds to the HTTP standard Status Code.
- Trailers
- Trailers is an alias for Fields.