# `ExFPL.HTTP`
[🔗](https://github.com/sgerrand/ex_fpl/blob/main/lib/ex_fpl/http.ex#L1)

Thin wrapper around `Req` that handles base URL, retries, telemetry and
optional session cookies for ExFPL API requests.

Library code should not call `Req` directly — go through `get/2` so the
test stub and telemetry events apply uniformly.

# `body`

```elixir
@type body() :: map() | list()
```

Decoded JSON body returned by the API.

# `error`

```elixir
@type error() ::
  {:http_error, status :: pos_integer(), body :: term()}
  | Exception.t()
  | term()
```

Errors returned by `get/2`.

# `get`

```elixir
@spec get(
  String.t(),
  keyword()
) :: {:ok, body()} | {:error, error()}
```

Issue a GET request to the ExFPL API.

Options:

  * `:session` — a `ExFPL.Session{}` whose `cookie` will be sent as the
    `cookie` request header.
  * `:params` — query string parameters (a keyword list).
  * any other key is forwarded to `Req.request/1`.

Returns `{:ok, body}` on a 2xx response and `{:error, reason}` otherwise.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
