diff --git a/lib/google/apis/core/base_service.rb b/lib/google/apis/core/base_service.rb index da9dccacd..81799bced 100644 --- a/lib/google/apis/core/base_service.rb +++ b/lib/google/apis/core/base_service.rb @@ -84,6 +84,8 @@ module Google # Base service for all APIs. Not to be used directly. # class BaseService + include Logging + # Root URL (host/port) for the API # @return [Addressable::URI] attr_accessor :root_url @@ -393,6 +395,8 @@ module Google end client.follow_redirect_count = 5 client.default_header = { 'User-Agent' => user_agent } + + client.debug_dev = logger if logger.level == Logger::DEBUG client end diff --git a/lib/google/apis/core/http_command.rb b/lib/google/apis/core/http_command.rb index 9eb123468..aff138317 100644 --- a/lib/google/apis/core/http_command.rb +++ b/lib/google/apis/core/http_command.rb @@ -155,6 +155,12 @@ module Google else @form_encoded = false end + + unless body + self.header['Content-Type'] = 'application/json' + self.header['Content-Length'] = 0 + end + end # Release any resources used by this command