httpx/sig/chainable.rbs
HoneyryderChuck 8b2ee0b466 remove form, json, ,xml and body from the Options class
Options become a bunch of session and connection level parameters, and requests do not need to maintain a separate Options object when they contain a body anymore, instead, objects is shared with the session, while request-only parameters get passed downwards to the request and its body. This reduces allocations of Options, currently the heaviest object to manage.
2024-06-11 18:23:45 +01:00

48 lines
2.3 KiB
Plaintext

module HTTPX
module Chainable
def request: (*Request, **untyped) -> Array[response]
| (Request, **untyped) -> response
| (verb, uri | [uri], **untyped) -> response
| (Array[[verb, uri] | [verb, uri, request_params]], **untyped) -> Array[response]
| (verb, _Each[uri | [uri, request_params]], **untyped) -> Array[response]
def accept: (String) -> Session
def wrap: () { (Session) -> void } -> void
def with: (options) -> Session
| (options) { (Session) -> void } -> void
def plugin: (:auth, ?options) -> Plugins::sessionAuthorization
| (:basic_auth, ?options) -> Plugins::sessionBasicAuth
| (:digest_auth, ?options) -> Plugins::sessionDigestAuth
| (:ntlm_auth, ?options) -> Plugins::sessionNTLMAuth
| (:aws_sdk_authentication, ?options) -> Plugins::sessionAwsSdkAuthentication
| (:brotli, ?options) -> Session
| (:cookies, ?options) -> Plugins::sessionCookies
| (:expect, ?options) -> Session
| (:follow_redirects, ?options) -> Plugins::sessionFollowRedirects
| (:upgrade, ?options) -> Session
| (:h2c, ?options) -> Session
| (:persistent, ?options) -> Plugins::sessionPersistent
| (:proxy, ?options) -> (Plugins::sessionProxy & Plugins::httpProxy)
| (:push_promise, ?options) -> Plugins::sessionPushPromise
| (:retries, ?options) -> Plugins::sessionRetries
| (:rate_limiter, ?options) -> Session
| (:stream, ?options) -> Plugins::sessionStream
| (:aws_sigv4, ?options) -> Plugins::awsSigV4Session
| (:grpc, ?options) -> Plugins::grpcSession
| (:response_cache, ?options) -> Plugins::sessionResponseCache
| (:circuit_breaker, ?options) -> Plugins::sessionCircuitBreaker
| (:oauth, ?options) -> Plugins::sessionOAuth
| (:callbacks, ?options) -> Plugins::sessionCallbacks
| (Symbol | Module, ?options) { (Class) -> void } -> Session
| (Symbol | Module, ?options) -> Session
private
def default_options: () -> Options
def branch: (options) -> Session
| (options) { (Session) -> void } -> Session
end
end