SYNOPSIS
use Testcontainers::Wait;
# Wait for HTTP 200 on /
my $wait = Testcontainers::Wait::for_http('/');
# Wait with custom options
my $wait = Testcontainers::Wait::for_http('/health',
port => '8080/tcp',
status_code => 200,
method => 'GET',
);
DESCRIPTION
Waits for an HTTP endpoint to return a successful response. Equivalent to Go's wait.ForHTTP().
This wait strategy makes a raw HTTP request (without depending on LWP or HTTP::Tiny) to keep dependencies minimal, matching WWW::Docker's approach.
HTTP path to request. Default: /.
Container port to connect to. If not set, uses the lowest exposed port.
Expected HTTP status code. Default: 200.
HTTP method. Default: GET.
Optional coderef that receives the response body and returns true/false.
Make an HTTP request and check the response. Returns true/false.
6 POD Errors
The following errors were encountered while parsing the POD:
- Around line 44:
Unknown directive: =attr
- Around line 55:
Unknown directive: =attr
- Around line 66:
Unknown directive: =attr
- Around line 77:
Unknown directive: =attr
- Around line 103:
Unknown directive: =attr
- Around line 146:
Unknown directive: =method