Skip to content

Instantly share code, notes, and snippets.

@tarolandia
Created November 2, 2012 15:09
Show Gist options
  • Save tarolandia/4001905 to your computer and use it in GitHub Desktop.
Save tarolandia/4001905 to your computer and use it in GitHub Desktop.
Mandrill API error very useful :/
req = Net::HTTP::Post.new('/api/1.0/messages/send.json', initheader = {'Content-Type' =>'application/json'})
req.body = @request.to_json
http = Net::HTTP.new(@uri.host, @uri.port)
http.use_ssl = true
response = http.start {|http| http.request(req) }
puts "Response #{response.code} #{response.message}: #{response.body}"
# => Response 500 Internal Server Error: {"status":"error","code":-100,"name":"GeneralError","message":"An unknown error occurred processing your request. Please try again later."}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment