lib/twilio-ruby/base/client_base.rb in twilio-ruby-7.1.1 vs lib/twilio-ruby/base/client_base.rb in twilio-ruby-7.2.0

- old
+ new

@@ -109,10 +109,13 @@ "twilio-ruby/#{Twilio::VERSION} (#{ruby_config['host_os']} #{ruby_config['host_cpu']}) Ruby/#{RUBY_VERSION}" headers['Accept-Charset'] = 'utf-8' user_agent_extensions.each { |extension| headers['User-Agent'] += " #{extension}" } - headers['Content-Type'] = 'application/x-www-form-urlencoded' if method == 'POST' && !headers['Content-Type'] + if ['POST', 'PUT'].include?(method) && !headers['Content-Type'] + headers['Content-Type'] = + 'application/x-www-form-urlencoded' + end headers['Accept'] = 'application/json' unless headers['Accept'] headers end end