Vug::HttpClientFactory
HTTP client factory. Creates configured HTTP::Client instances for making requests.
Constructors
new(config : Config)
SourceInstance methods
create_client(uri : URI, read_timeout : Time::Span, connect_timeout : Time::Span | Nil = nil, write_timeout : Time::Span | Nil = nil) : HTTP::Client
Create a new HTTP client with custom timeout settings. Useful for requests that may need longer timeouts (e.g., slow servers).
Create a new HTTP client configured with the current settings.
Release/close a client after use. In Crystal, HTTP::Client handles connection pooling internally, so we just close the client to ensure clean state. Execute a block with a managed HTTP client lifecycle. Creates a client, yields it, and ensures it is closed afterward.