HTTP/1.1 connection as a stateless data struct.
Wraps a TCP or SSL transport. Sequential request-response with keep-alive support.
Summary
Functions
Returns whether the connection may accept another request.
Receives the next chunk of response body data.
Receives response status and headers after a request has been sent via open_request/5.
Types
@type t() :: %Quiver.Conn.HTTP1{ buffer: binary(), closed: boolean(), host: String.t(), keep_alive: boolean(), parse_state: Quiver.Conn.HTTP1.Parse.parse_state(), port: :inet.port_number(), recv_timeout: timeout(), request_ref: reference() | nil, request_state: :idle | :in_flight, scheme: :http | :https, transport: Quiver.Transport.t(), transport_mod: module() }
Functions
Returns whether the connection may accept another request.
Does not probe the underlying transport -- a TCP reset that occurred since the last send/recv will not be detected here. Dead connections are discovered on the next request attempt.
Receives the next chunk of response body data.
Returns {:ok, conn, chunk} with binary data, {:done, conn} when the body is
complete, or {:error, conn, reason} on failure.
@spec recv_response_headers(t()) :: {:ok, t(), non_neg_integer(), [{String.t(), String.t()}], [binary()]} | {:error, t(), term()}
Receives response status and headers after a request has been sent via open_request/5.
Returns any body data that arrived alongside the headers in initial_body_chunks.
Call recv_body_chunk/1 to continue receiving the body.
@spec stream_request( t(), Quiver.Conn.method(), String.t(), Quiver.Conn.headers(), Enumerable.t() ) :: {:ok, t(), Quiver.Response.t()} | {:error, t(), term()}