# `YouTubeTranscriptNet.Transport`
[🔗](https://github.com/youtube-transcript/youtubetranscript-elixir/blob/v0.1.0/lib/youtubetranscript_net/transport.ex#L1)

How the SDK talks HTTP. A transport is a 5-arity function:

    (method, url, headers, body, timeout_ms) ->
      {:ok, %{status: integer, headers: %{lowercase_name => value}, body: binary}}
      | {:error, :timeout}
      | {:error, reason}

`method` is `:get`, `:post` or `:delete`; `headers` is a list of `{name, value}` strings;
`body` is a JSON string or `nil`. Any `{:error, reason}` other than `:timeout` becomes a
`NETWORK_ERROR`. The default is `YouTubeTranscriptNet.Transport.Httpc`; pass your own
(for example one built on Req or Finch) with `YouTubeTranscriptNet.new(transport: fun)`.
The transport must not retry: retries are the SDK's job.

# `response`

```elixir
@type response() :: %{
  status: non_neg_integer(),
  headers: %{required(String.t()) =&gt; String.t()},
  body: binary()
}
```

# `t`

```elixir
@type t() :: (atom(),
        String.t(),
        [{String.t(), String.t()}],
        binary()
        | nil,
        non_neg_integer() -&gt;
          {:ok, response()} | {:error, term()})
```

---

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