mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-06 00:02:08 -04:00
The reference for a request verb is now the string which is used everywhere else, instead of the symbol corresponding to it. This was an artifact from the import from httprb, and there is no advantage in it, since these strings are frozen in most use cases, and the transformations from symbol to strings being performed everywhere are prooof that keeping the atom isn't really bringing any benefit.
87 lines
1.8 KiB
Plaintext
87 lines
1.8 KiB
Plaintext
module HTTPX
|
|
class Request
|
|
extend Forwardable
|
|
include Callbacks
|
|
|
|
METHODS: Array[Symbol]
|
|
USER_AGENT: String
|
|
|
|
attr_reader verb: verb
|
|
attr_reader uri: URI::Generic
|
|
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?
|
|
|
|
@trailers: Headers?
|
|
@informational_status: Integer?
|
|
@query: String?
|
|
@drainer: Enumerator[String, void]?
|
|
|
|
def initialize: (Symbol | String, generic_uri, ?options) -> 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 read_timeout: () -> Numeric
|
|
|
|
def write_timeout: () -> Numeric
|
|
|
|
def request_timeout: () -> Numeric
|
|
|
|
class Body
|
|
@headers: Headers
|
|
@body: body_encoder?
|
|
@unbounded_body: bool
|
|
|
|
def initialize: (Headers, Options) -> untyped
|
|
def each: () { (String) -> void } -> void
|
|
| () -> Enumerable[String]
|
|
|
|
def rewind: () -> void
|
|
def empty?: () -> bool
|
|
def bytesize: () -> (Integer | Float)
|
|
def stream: (Transcoder::_Encoder) -> bodyIO
|
|
def unbounded_body?: () -> bool
|
|
def chunked?: () -> bool
|
|
def chunk!: () -> void
|
|
def inspect: () -> String
|
|
end
|
|
|
|
class ProcIO
|
|
@block: ^(String) -> void
|
|
|
|
def initialize: (^(String) -> void) -> untyped
|
|
|
|
def write: (String data) -> Integer
|
|
end
|
|
end
|
|
end
|