httpx/sig/response.rbs
HoneyryderChuck 0d58408c58 compression plugins for gzip and deflate supported by default
most of the code was moved to the transcoder layer.

The `compression_threshold_size` option has been removed.

The `:compression/brotli` plugin becomes only ´:brotli`, and depends on
the new transcoding APIs.

options to skip compression and decompression were added.
2023-09-20 17:57:41 +01:00

89 lines
1.7 KiB
Plaintext

module HTTPX
interface _Response
def finished?: () -> bool
def raise_for_status: () -> self
def error: () -> StandardError?
end
class Response
extend Forwardable
include Callbacks
include _Response
include _ToS
include _Reader
attr_reader status: Integer
attr_reader headers: Headers
attr_reader body: Body
attr_reader version: String
@options: Options
@request: Request
@content_type: ContentType
def copy_to: (_ToPath | _Writer destination) -> void
def close: () -> void
def uri: () -> URI::Generic
def merge_headers: (_Each[[String, headers_value]]) -> void
def bodyless?: () -> bool
def content_type: () -> ContentType
def complete?: () -> bool
def json: (?json_options opts) -> untyped
def form: () -> Hash[String, untyped]
private
def initialize: (Request request, String | Integer status, String version, headers?) -> untyped
def no_data?: () -> bool
def decode:(Transcoder::_Decode transcoder, ?untyped options) -> untyped
end
class ContentType
MIME_TYPE_RE: Regexp
CHARSET_RE: Regexp
@header_value: String?
@mime_type: String?
@charset: String?
def mime_type: () -> String?
def charset: () -> String?
private
def initialize: (String? header_value) -> void
end
class ErrorResponse
include _Response
include Loggable
extend Forwardable
@options: Options
@error: Exception
attr_reader request: Request
attr_reader response: Response?
def status: () -> (Integer | _ToS)
def uri: () -> URI::Generic
def close: () -> void
private
def initialize: (Request, Exception, options) -> untyped
end
type response = Response | ErrorResponse
end