class Requests::Response
Attributes
body[R]
headers[R]
status[R]
Public Class Methods
new(status, headers, body)
click to toggle source
# File lib/requests.rb, line 82 def initialize(status, headers, body) @status, @headers, @body = Integer(status), headers, body end
Public Instance Methods
encoding()
click to toggle source
TODO Verify that this is based on content-type header
# File lib/requests.rb, line 92 def encoding @body.encoding end
json()
click to toggle source
TODO Verify that JSON can parse data without encoding stuff
# File lib/requests.rb, line 87 def json JSON.parse(@body) end
text()
click to toggle source
TODO this will probably do something related to encoding if necessary
# File lib/requests.rb, line 97 def text @body end