diff --git a/httparty.gemspec b/httparty.gemspec index 5a326b0..91c4b2e 100644 --- a/httparty.gemspec +++ b/httparty.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |s| s.summary = %q{Makes http fun! Also, makes consuming restful web services dead easy.} s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.} - s.add_dependency 'multi_json', "~> 1.3" + s.add_dependency 'multi_json', "~> 1.0" s.add_dependency 'multi_xml' s.post_install_message = "When you HTTParty, you must party hard!" diff --git a/lib/httparty/parser.rb b/lib/httparty/parser.rb index dfcf750..8f2d45c 100644 --- a/lib/httparty/parser.rb +++ b/lib/httparty/parser.rb @@ -113,7 +113,12 @@ module HTTParty end def json - MultiJson.load(body) + # https://github.com/sferik/rails/commit/5e62670131dfa1718eaf21ff8dd3371395a5f1cc + if MultiJson.respond_to?(:adapter) + MultiJson.load(body) + else + MultiJson.decode(json) + end end def yaml