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()
Link to this type

req_params(method_alt)

View Source
@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.

@spec get_info(request()) :: any()

Get the custom data that was put with set_info/2

Link to this function

request!(client, meth_path_headers, body, timeout \\ 10000)

View Source
@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.

Link to this function

request_collectable!(client, arg)

View Source
@spec request_collectable!(client(), req_params(atom())) :: request()
@spec set_info(request(), any()) :: request()

Put arbitrary custom data that can be accesses with get_info/1