Class: MailchimpPsuedoJSONParser

Inherits:
HTTParty::Parser
  • Object
show all
Defined in:
lib/mailchimp/ext/httparty.rb

Instance Method Summary collapse

Instance Method Details

#jsonObject

Unfornately Mailchimp’s API returns invalid JSON for some valid requests, specifically mandrill’s users/ping. We need to just pass that through instead of blowing up inside of HTTParty so that we can do something with it later.



5
6
7
8
9
10
11
# File 'lib/mailchimp/ext/httparty.rb', line 5

def json
  begin
    MultiJson.decode(body)
  rescue
    body
  end
end