class QUIC::Client
- QUIC::Client
- Reference
- Object
Defined in:
lsquic/client.crConstant Summary
-
ENGINE_FLAGS =
LibLsquic::LSENG_HTTP
-
REQUIRED_HEADERS =
{":method", ":scheme", ":path", ":authority"}
Constructors
- .new(host : String, port = nil, tls : Bool | OpenSSL::SSL::Context::Client = false)
- .new(uri : URI, tls = nil)
- .new(uri : URI, tls = nil, &)
- .new(host : String, port = nil, tls = false, &)
Class Method Summary
- .delete(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
- .delete(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
- .delete(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
- .delete(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
- .ea_packets_out(peer_ctx : Pointer(Void), specs : Pointer(LibLsquic::OutSpec), count : LibC::UInt)
- .exec(method, url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
- .exec(method, url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
- .get(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
- .get(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
- .get(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
- .get(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
- .head(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
- .head(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
- .head(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
- .head(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
- .on_close(s : LibLsquic::StreamT, stream_if_ctx : Pointer(Void))
- .on_conn_closed(c : LibLsquic::ConnT)
- .on_new_conn(stream_if_ctx : Pointer(Void), c : LibLsquic::ConnT)
- .on_new_stream(stream_if_ctx : Pointer(Void), s : LibLsquic::StreamT)
- .on_read(s : LibLsquic::StreamT, stream_if_ctx : Pointer(Void))
- .on_write(s : LibLsquic::StreamT, stream_if_ctx : Pointer(Void))
- .options(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
- .options(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
- .options(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
- .options(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
- .patch(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
- .patch(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
- .patch(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
- .patch(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
- .post(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
- .post(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
- .post(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
- .post(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
- .put(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
- .put(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
- .put(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
- .put(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
- .stream_readf(stream_if_ctx : Pointer(Void), buf : Pointer(UInt8), buf_len : LibC::SizeT, fin : LibC::Int)
Instance Method Summary
-
#basic_auth(username, password)
Configures this client to perform basic authentication in every request.
- #before_request(&callback : HTTP::Request -> )
- #client_process_conns(engine)
- #close
- #connect_timeout=(connect_timeout : Number)
- #connect_timeout=(connect_timeout : Time::Span)
- #delete(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
- #delete(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, &)
- #delete(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
- #delete(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, &)
- #delete(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
- #delete(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
- #dns_timeout=(dns_timeout : Number)
- #dns_timeout=(dns_timeout : Time::Span)
- #exec(method : String, path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
- #exec(request : HTTP::Request) : HTTP::Client::Response
- #exec(method : String, path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, &)
- #exec(request : HTTP::Request, &)
- #family : Socket::Family
- #family=(family : Socket::Family)
- #get(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
- #get(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, &)
- #get(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
- #get(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, &)
- #get(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
- #get(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
- #head(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
- #head(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, &)
- #head(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
- #head(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, &)
- #head(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
- #head(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
- #host : String
- #options(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
- #options(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, &)
- #options(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
- #options(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, &)
- #options(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
- #options(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
- #patch(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
- #patch(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, &)
- #patch(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
- #patch(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, &)
- #patch(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
- #patch(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
- #port : Int32
- #post(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
- #post(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, &)
- #post(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
- #post(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, &)
- #post(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
- #post(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
- #put(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
- #put(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, &)
- #put(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
- #put(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO, &)
- #put(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
- #put(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
- #read_timeout=(read_timeout : Number)
- #read_timeout=(read_timeout : Time::Span)
- #run_engine
- #socket : UDPSocket
- #tls : OpenSSL::SSL::Context::Client
- #tls? : OpenSSL::SSL::Context::Client | Nil
Constructor Detail
Class Method Detail
def self.delete(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
#
def self.delete(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
#
def self.delete(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
#
def self.delete(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
#
def self.ea_packets_out(peer_ctx : Pointer(Void), specs : Pointer(LibLsquic::OutSpec), count : LibC::UInt)
#
def self.exec(method, url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
#
def self.exec(method, url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
#
def self.get(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
#
def self.get(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
#
def self.get(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
#
def self.get(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
#
def self.head(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
#
def self.head(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
#
def self.head(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
#
def self.head(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
#
def self.options(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
#
def self.options(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
#
def self.options(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
#
def self.options(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
#
def self.patch(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
#
def self.patch(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
#
def self.patch(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
#
def self.patch(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
#
def self.post(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
#
def self.post(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
#
def self.post(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
#
def self.post(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
#
def self.put(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
#
def self.put(url : String | URI, headers : HTTP::Headers | Nil = nil, body : BodyType = nil, tls = nil, &)
#
def self.put(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash) : HTTP::Client::Response
#
def self.put(url, headers : HTTP::Headers | Nil = nil, tls = nil, *, form : String | IO | Hash, &)
#
def self.stream_readf(stream_if_ctx : Pointer(Void), buf : Pointer(UInt8), buf_len : LibC::SizeT, fin : LibC::Int)
#
Instance Method Detail
def basic_auth(username, password)
#
Configures this client to perform basic authentication in every request.
def delete(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
#
def delete(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
#
def delete(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
#
def delete(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
#
def exec(method : String, path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
#
def get(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
#
def get(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
#
def get(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
#
def get(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
#
def head(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
#
def head(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
#
def head(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
#
def head(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
#
def options(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
#
def options(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
#
def options(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
#
def options(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
#
def patch(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
#
def patch(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
#
def patch(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
#
def patch(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
#
def post(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
#
def post(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
#
def post(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
#
def post(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
#
def put(path, headers : HTTP::Headers | Nil = nil, body : BodyType = nil) : HTTP::Client::Response
#
def put(path, headers : HTTP::Headers | Nil = nil, *, form : String | IO) : HTTP::Client::Response
#
def put(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple) : HTTP::Client::Response
#
def put(path, headers : HTTP::Headers | Nil = nil, *, form : Hash(String, String) | NamedTuple, &)
#