httpx/sig/request.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

72 lines
1.4 KiB
Plaintext

module HTTPX
class Request
extend Forwardable
include Callbacks
METHODS: Array[Symbol]
USER_AGENT: String
attr_reader verb: verb
attr_reader uri: http_uri
attr_reader headers: Headers
attr_reader body: Body
attr_reader state: Symbol
attr_reader options: Options
attr_reader response: response?
attr_reader drain_error: StandardError?
attr_accessor peer_address: ipaddr?
attr_writer persistent: bool
@query_params: Hash[interned, untyped]?
@trailers: Headers?
@informational_status: Integer?
@query: String?
@drainer: Enumerator[String, void]?
def initialize: (Symbol | String verb, generic_uri uri, Options options, ?request_params params) -> untyped
def interests: () -> (:r | :w)
def merge_headers: (_Each[[String, headers_value]]) -> void
def scheme: () -> String
def response=: (response) -> void
def path: () -> String
def authority: () -> String
def origin: () -> String
def query: () -> String
def drain_body: () -> String?
def inspect: () -> String
def transition: (Symbol) -> void
def expects?: () -> boolish
def trailers: () -> Headers
def trailers?: () -> boolish
def persistent?: () -> bool
def read_timeout: () -> Numeric?
def write_timeout: () -> Numeric?
def request_timeout: () -> Numeric?
private
def initialize_body: (Options options) -> Transcoder::_Encoder?
end
end