class Stormpath::Http::Response
Attributes
body[R]
headers[RW]
http_status[R]
Public Class Methods
new(http_status, content_type, body, content_length)
click to toggle source
# File lib/stormpath-sdk/http/response.rb 22 def initialize(http_status, content_type, body, content_length) 23 @http_status = http_status 24 @headers = HTTP::Message::Headers.new 25 @body = body 26 @headers.content_type = content_type 27 @headers.body_size = content_length 28 end
Public Instance Methods
client_error?()
click to toggle source
# File lib/stormpath-sdk/http/response.rb 30 def client_error? 31 (http_status >= 400) && http_status < 500 32 end
error?()
click to toggle source
# File lib/stormpath-sdk/http/response.rb 38 def error? 39 client_error? || server_error? 40 end
server_error?()
click to toggle source
# File lib/stormpath-sdk/http/response.rb 34 def server_error? 35 (http_status >= 500) && http_status < 600 36 end