Http
type NetworkError
Variants
ConnectionRefusedTimeoutDnsErrorSslErrorNotImplementedMockEmptyUnknown
record HttpResponse
Fields
record HttpError
Fields
kindNetworkErrormessageString
record HttpOptions
Fields
timeoutIntegeroptional
module Http
A capability: every member performs a real network request, so a test can replace it for a lexical region with with Http = ... rather than mutating global mock state (kexhq/kex#143).
get
get(url: String) -> Result<HttpResponse, HttpError>
get(url: String, opts: HttpOptions) -> Result<HttpResponse, HttpError>
post
post(url: String, body: String) -> Result<HttpResponse, HttpError>
post(url: String, body: String) -> HttpOptions -> Result<HttpResponse, HttpError>
put
put(url: String, body: String) -> Result<HttpResponse, HttpError>
put(url: String, body: String) -> HttpOptions -> Result<HttpResponse, HttpError>
patch
patch(url: String, body: String) -> Result<HttpResponse, HttpError>
patch(url: String, body: String) -> HttpOptions -> Result<HttpResponse, HttpError>
delete
delete(url: String) -> Result<HttpResponse, HttpError>
delete(url: String, opts: HttpOptions) -> Result<HttpResponse, HttpError>
head
head(url: String) -> Result<HttpResponse, HttpError>
head(url: String, opts: HttpOptions) -> Result<HttpResponse, HttpError>
options
options(url: String) -> Result<HttpResponse, HttpError>
options(url: String, opts: HttpOptions) -> Result<HttpResponse, HttpError>