Mint v1.0.0 Mint.Types View Source
HTTP-related types.
Link to this section Summary
Types
An error reason.
HTTP headers.
An HTTP/2-specific response to a request.
A request reference that uniquely identifies a request.
A response to a request.
The scheme to use when connecting to an HTTP server.
An HTTP status code.
Link to this section Types
error()
View Source
error() :: Mint.TransportError.t() | Mint.HTTPError.t()
error() :: Mint.TransportError.t() | Mint.HTTPError.t()
An error reason.
headers() View Source
HTTP headers.
Headers are sent and received as lists of two-element tuples containing two strings, the header name and header value.
http2_response()
View Source
http2_response() ::
{:pong, request_ref()}
| {:push_promise, request_ref(), promised_request_ref :: request_ref(),
headers()}
http2_response() :: {:pong, request_ref()} | {:push_promise, request_ref(), promised_request_ref :: request_ref(), headers()}
An HTTP/2-specific response to a request.
This type of response is only returned on HTTP/2 connections. See response/0
for
more response types.
request_ref()
View Source
request_ref() :: reference()
request_ref() :: reference()
A request reference that uniquely identifies a request.
Responses for a request are always tagged with a request reference so that you
can connect each response to the right request. Also see Mint.HTTP.request/5
.
response()
View Source
response() ::
{:status, request_ref(), status()}
| {:headers, request_ref(), headers()}
| {:data, request_ref(), body_chunk :: binary()}
| {:done, request_ref()}
| {:error, request_ref(), reason :: term()}
| http2_response()
response() :: {:status, request_ref(), status()} | {:headers, request_ref(), headers()} | {:data, request_ref(), body_chunk :: binary()} | {:done, request_ref()} | {:error, request_ref(), reason :: term()} | http2_response()
A response to a request.
Terms of this type are returned as responses to requests. See Mint.HTTP.stream/2
for more information.
scheme()
View Source
scheme() :: :http | :https
scheme() :: :http | :https
The scheme to use when connecting to an HTTP server.
status()
View Source
status() :: non_neg_integer()
status() :: non_neg_integer()
An HTTP status code.
The type for an HTTP is a generic non-negative integer since we don't formally check that
the response code is in the "common" range (200..599
).