View Source Tulle.Http (tulle v0.6.3)
Make HTTP2 requests with a DiscordEx.Http2.Client
.
Summary
Types
A Collectable
that writes to an HTTP request stream.
Functions
Sends EOF for the collectable returned by request_collectable!/3
.
Get the custom data that was put with set_info/2
Sends a request. Returns a triple of the status, the headers, and the response body stream.
Put arbitrary custom data that can be accesses with get_info/1
Types
@type client() :: GenServer.server()
@type req_params(method_alt) :: {method :: String.t() | method_alt, path :: String.t(), Mint.Types.headers()}
@opaque request()
A Collectable
that writes to an HTTP request stream.
Created with request_collectable/3
.
When done sending, close_request!/1
must be called to signal the EOF.
Functions
@spec close_request!(request()) :: {pos_integer(), Mint.Types.headers(), iodata_stream :: Enum.t()}
Sends EOF for the collectable returned by request_collectable!/3
.
Returns a triple of the status, the headers, and the response body stream.
Get the custom data that was put with set_info/2
@spec request!(client(), req_params(atom()), iodata() | nil, timeout()) :: {pos_integer(), Mint.Types.headers(), iodata_stream :: Enum.t()}
Sends a request. Returns a triple of the status, the headers, and the response body stream.
@spec request_collectable!(client(), req_params(atom())) :: request()
Put arbitrary custom data that can be accesses with get_info/1