class

Telegram::HTTPClientWrapper

Inherits Reference < Object

Enhanced HTTP client wrapper with production-ready features

Constructors

new(config : HTTPClientConfig = HTTPClientConfig.new)
Source
new(client : HTTP::Client, config : HTTPClientConfig = HTTPClientConfig.new)

Initialize with custom HTTP client

Source

Instance methods

close

Close the client and cleanup resources

Source
connected?

Check if client is connected

Source
delete(url : String, headers : HTTP::Headers | Nil = nil) : HTTP::Client::Response

Execute a DELETE request with automatic retry logic

Source
get(url : String, headers : HTTP::Headers | Nil = nil) : HTTP::Client::Response

Execute a GET request with automatic retry logic

Source
post(url : String, headers : HTTP::Headers | Nil = nil, body : String | Nil = nil) : HTTP::Client::Response

Execute a POST request with automatic retry logic

Source
post_multipart(url : String, multipart_data : Tuple(String, IO), headers : HTTP::Headers | Nil = nil) : HTTP::Client::Response

Execute a multipart POST request

Source
put(url : String, headers : HTTP::Headers | Nil = nil, body : String | Nil = nil) : HTTP::Client::Response

Execute a PUT request with automatic retry logic

Source