View Source Kashka.Http (kashka v0.3.0)

Helper module-wrapper around Mint

Link to this section Summary

Link to this section Types

@type args() :: url() | url_with_opts()
@type conn() :: t() | args()
@type t() :: %Kashka.Http{
  fix_host: boolean(),
  fix_port: boolean(),
  fix_schema: boolean(),
  headers: Mint.Types.headers(),
  keepalive: boolean(),
  mint: Mint.HTTP.t(),
  protocols: :http1 | :http2 | :any,
  uri: URI.t()
}
@type url() :: String.t()
@type url_with_opts() :: [
  url: url(),
  headers: Mint.Types.headers(),
  fix_host: boolean(),
  fix_port: boolean(),
  fix_schema: boolean(),
  keepalive: boolean(),
  protocols: :http1 | :http2 | :any
]

Link to this section Functions

Link to this function

append_path(state, path)

View Source
@spec close(t()) :: :ok
@spec connect(args()) :: t()
Link to this function

reconnect_to(state, url)

View Source
@spec reconnect_to(t(), String.t()) :: %Kashka.Http{
  fix_host: term(),
  fix_port: term(),
  fix_schema: term(),
  headers: term(),
  keepalive: term(),
  mint: term(),
  protocols: term(),
  uri: term()
}
Link to this function

request(state, method, path, headers, body, timeout \\ 30000)

View Source
@spec request(
  t() | args(),
  String.t(),
  String.t(),
  Mint.Types.headers(),
  iodata(),
  non_neg_integer()
) :: {:ok, t(), non_neg_integer(), iodata()}