# `Finch.Request`
[🔗](https://github.com/sneako/finch/blob/v0.23.0/lib/finch/request.ex#L1)

A request struct.

# `body`

```elixir
@type body() ::
  iodata()
  | {:stream, Enumerable.t()}
  | {:stream, Finch.req_body_fun(term())}
  | nil
```

Optional request body.

# `build_opt`

```elixir
@type build_opt() :: {:unix_socket, String.t()} | {:pool_tag, Finch.Pool.pool_tag()}
```

# `build_opts`

```elixir
@type build_opts() :: [build_opt()]
```

Options used by `build/5`.

# `headers`

```elixir
@type headers() :: Mint.Types.headers()
```

Request headers.

# `method`

```elixir
@type method() ::
  :get | :post | :head | :patch | :delete | :options | :put | String.t()
```

An HTTP request method represented as an `atom()` or a `String.t()`.

The following atom methods are supported: `:get`, `:post`, `:put`, `:patch`, `:delete`, `:head`, `:options`.
You can use any arbitrary method by providing it as a `String.t()`.

# `private_metadata`

```elixir
@type private_metadata() :: %{optional(atom()) =&gt; term()}
```

# `t`

```elixir
@type t() :: %Finch.Request{
  body: body(),
  headers: headers(),
  host: String.t() | nil,
  method: String.t(),
  path: String.t(),
  pool_tag: Finch.Pool.pool_tag(),
  port: :inet.port_number(),
  private: private_metadata(),
  query: String.t() | nil,
  scheme: Mint.Types.scheme(),
  unix_socket: String.t() | nil
}
```

# `url`

```elixir
@type url() :: String.t() | URI.t()
```

A Uniform Resource Locator, the address of a resource on the Web.

# `put_private`

```elixir
@spec put_private(t(), key :: atom(), value :: term()) :: t()
```

Sets a new **private** key and value in the request metadata. This storage is meant to be used by libraries
and frameworks to inject information about the request that needs to be retrieved later on, for example,
from handlers that consume `Finch.Telemetry` events.

---

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