-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathresponse.rbs
97 lines (61 loc) · 1.79 KB
/
response.rbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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