# `Testcontainers.HttpWaitStrategy`
[🔗](https://github.com/testcontainers/testcontainers-elixir/blob/main/lib/wait_strategy/http_wait_strategy.ex#L1)

Considers the container as ready when a http request is successful.

# `t`

```elixir
@type t() :: %Testcontainers.HttpWaitStrategy{
  endpoint: String.t(),
  headers: [{binary(), binary()}],
  match: (map() -&gt; boolean()),
  max_retries: term(),
  method: :get | :post | :patch | :put | :delete | :head | :options | :trace,
  port: integer(),
  protocol: String.t(),
  status_code: integer(),
  timeout: integer()
}
```

The HttpWaitStrategy struct

## Options

- `:endpoint` - The endpoint to request

- `:port` - The exposed port of your container

Verification Options:

- `:status_code` - Check if the request responds with the given status code

- `:match` - Run your custom matcher on the given response. A 1-arity function
  taking a response as first parameter and must return a boolean

Request Options:

- `:protocol` - which protocol to use, defaults to `http`

- `:method` - the request method, one of [`:head`, `:get`, `:delete`, `:trace`, `:options`, `:post`, `:put`, `:patch`]

- `:timeout` - The timeout of the request (in milliseconds), defaults to `5000`

- `:headers` - Apply any headers to your request

# `new`

Creates a new HttpWaitStrategy to wait until a http requests succeeds.

---

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