Sha256: f8a18c5ceb7be9b70f1aa66db8fc277edce687f877fa7e0f37656fae412f7b07

Contents?: true

Size: 1.79 KB

Versions: 10

Compression:

Stored size: 1.79 KB

Contents

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 peer_address: () -> ipaddr?

    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]

    def initialize: (Request request, String | Integer status, String version, headers?) -> void

    private

    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 peer_address: () -> ipaddr?

    def close: () -> void

    private

    def initialize: (Request, Exception, options) -> untyped
  end

  type response = Response | ErrorResponse
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
httpx-1.2.3 sig/response.rbs
httpx-1.2.2 sig/response.rbs
httpx-1.2.1 sig/response.rbs
httpx-1.2.0 sig/response.rbs
httpx-1.1.5 sig/response.rbs
httpx-1.1.4 sig/response.rbs
httpx-1.1.3 sig/response.rbs
httpx-1.1.2 sig/response.rbs
httpx-1.1.1 sig/response.rbs
httpx-1.1.0 sig/response.rbs