lib/sendgrid_ruby.rb in sendgrid_ruby-0.0.1 vs lib/sendgrid_ruby.rb in sendgrid_ruby-0.0.3
- old
+ new
@@ -20,10 +20,12 @@
form['api_user'] = @username
form['api_key'] = @password
RestClient.log = $stderr if @debug_output
- response = RestClient.post 'https://api.sendgrid.com/api/mail.send.json', form, :content_type => :json
+ headers = Hash.new
+ headers[:content_type] = :json
+ response = RestClient.post 'https://api.sendgrid.com/api/mail.send.json', form, :content_type => :json, "User-Agent" => "sendgrid/#{SendgridRuby::VERSION};ruby"
JSON.parse(response.body)
end
end