http library

Interfaces and type definitions for wasi:http.

To actually use these interfaces, define a component for a world importing them (e.g. with serviceComponent for wasi:cli/command exposing them via ServiceImports).

Classes

Client
This interface defines an HTTP client for sending "outgoing" requests.
Handler
This interface defines a handler of HTTP Requests.
TypesErrorCode
These cases are inspired by the IANA HTTP Proxy Error Types: www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types
TypesErrorCodeConfigurationError
TypesErrorCodeConnectionLimitReached
TypesErrorCodeConnectionReadTimeout
TypesErrorCodeConnectionRefused
TypesErrorCodeConnectionTerminated
TypesErrorCodeConnectionTimeout
TypesErrorCodeConnectionWriteTimeout
TypesErrorCodeDestinationIpProhibited
TypesErrorCodeDestinationIpUnroutable
TypesErrorCodeDestinationNotFound
TypesErrorCodeDestinationUnavailable
TypesErrorCodeDnsError
TypesErrorCodeDnsTimeout
TypesErrorCodeHttpProtocolError
TypesErrorCodeHttpRequestBodySize
TypesErrorCodeHttpRequestDenied
TypesErrorCodeHttpRequestHeaderSectionSize
TypesErrorCodeHttpRequestHeaderSize
TypesErrorCodeHttpRequestLengthRequired
TypesErrorCodeHttpRequestMethodInvalid
TypesErrorCodeHttpRequestTrailerSectionSize
TypesErrorCodeHttpRequestTrailerSize
TypesErrorCodeHttpRequestUriInvalid
TypesErrorCodeHttpRequestUriTooLong
TypesErrorCodeHttpResponseBodySize
TypesErrorCodeHttpResponseContentCoding
TypesErrorCodeHttpResponseHeaderSectionSize
TypesErrorCodeHttpResponseHeaderSize
TypesErrorCodeHttpResponseIncomplete
TypesErrorCodeHttpResponseTimeout
TypesErrorCodeHttpResponseTrailerSectionSize
TypesErrorCodeHttpResponseTrailerSize
TypesErrorCodeHttpResponseTransferCoding
TypesErrorCodeHttpUpgradeFailed
TypesErrorCodeInternalError
TypesErrorCodeLoopDetected
TypesErrorCodeTlsAlertReceived
TypesErrorCodeTlsCertificateError
TypesErrorCodeTlsProtocolError
TypesFields
This following block defines the fields resource which corresponds to HTTP standard Fields. Fields are a common representation used for both Headers and Trailers.
TypesHeaderError
This type enumerates the different kinds of errors that may occur when setting or appending to a fields resource.
TypesHeaderErrorForbidden
TypesHeaderErrorImmutable
TypesHeaderErrorInvalidSyntax
TypesHeaderErrorOther
TypesHeaderErrorSizeExceeded
TypesMethod
This type corresponds to HTTP standard Methods.
TypesMethodConnect
TypesMethodDelete
TypesMethodGet
TypesMethodHead
TypesMethodOptions
TypesMethodOther
TypesMethodPatch
TypesMethodPost
TypesMethodPut
TypesMethodTrace
TypesRequest
Represents an HTTP Request.
TypesRequestOptions
Parameters for making an HTTP Request. Each of these parameters is currently an optional timeout applicable to the transport layer of the HTTP protocol.
TypesRequestOptionsError
This type enumerates the different kinds of errors that may occur when setting fields of a request-options resource.
TypesRequestOptionsErrorImmutable
TypesRequestOptionsErrorNotSupported
TypesRequestOptionsErrorOther
TypesResponse
Represents an HTTP Response.
TypesScheme
This type corresponds to HTTP standard Related Schemes.
TypesSchemeHttp
TypesSchemeHttps
TypesSchemeOther