class Pact::Hal::HttpClient::Response

Public Instance Methods

body() click to toggle source
# File lib/pact/hal/http_client.rb, line 101
def body
  bod = raw_body
  if bod && bod != ''
    JSON.parse(bod)
  else
    nil
  end
end
json?() click to toggle source
# File lib/pact/hal/http_client.rb, line 122
def json?
  self['content-type'] && self['content-type'] =~ /json/
end
raw_body() click to toggle source
# File lib/pact/hal/http_client.rb, line 110
def raw_body
  __getobj__().body
end
status() click to toggle source
# File lib/pact/hal/http_client.rb, line 114
def status
  code.to_i
end
success?() click to toggle source
# File lib/pact/hal/http_client.rb, line 118
def success?
  __getobj__().code.start_with?("2")
end