forked from hadashiA/ChibiRuby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp__response.rbs
More file actions
50 lines (34 loc) · 1.26 KB
/
Copy pathhttp__response.rbs
File metadata and controls
50 lines (34 loc) · 1.26 KB
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
# <auto-generated />
# Source: ChibiRuby.NIO.HttpResponseMembers
# HTTP::Response — one HTTP exchange's buffered response. 4xx/5xx never raise; branch via #success? / #ensure_success_status!.
class HTTP::Response < Object
# Numeric HTTP status code.
def status: () -> Integer
# Response headers as HTTP::Headers.
def headers: () -> HTTP::Headers
# Response body as HTTP::Body.
def body: () -> HTTP::Body
# Request URI as a String.
def uri: () -> String
# Negotiated HTTP protocol version, e.g. "1.1".
def version: () -> String
# Content-Type header value, or nil.
def content_type: () -> String?
# True iff status is 2xx.
def success?: () -> bool
# True iff status is 3xx (only observable when redirects are not followed).
def redirect?: () -> bool
# True iff status is 4xx.
def client_error?: () -> bool
# True iff status is 5xx.
def server_error?: () -> bool
# True iff status is 4xx or 5xx.
def error?: () -> bool
# Raises HTTP::Error when status ≥ 400; otherwise returns self.
def ensure_success_status!: () -> self
# Parses the body via JSON.parse (cached). NotImplementedError unless DefineJson() was called.
def json: () -> untyped
def inspect: () -> String
# Alias for body.to_s.
def to_s: () -> String
end