View Source ExTypesense.HttpClient (ExTypesense v0.2.2)

Http client for Typesense server.

Link to this section Summary

Link to this section Types

@type request_body() :: iodata() | nil
@type request_method() :: :get | :post | :delete | :patch | :put
@type request_path() :: String.t()

Link to this section Functions

Link to this function

run(request_method, request_path, body \\ nil, query \\ %{})

View Source (since 0.1.0)
@spec run(request_method(), request_path(), request_body(), map()) ::
  {:ok, map()} | {:error, map()}

Req client.

examples

Examples

iex> HttpClient.run(:get, "/collections")
{:ok,
  [%{
    "created_at" => 123456789,
    "default_sorting_field" => "num_employees",
    "fields" => [...],
    "name" => "companies",
    "num_documents" => 0,
    "symbols_to_index" => [],
    "token_separators" => []
  }]
}