diff --git a/lib/google/api_client/reference.rb b/lib/google/api_client/reference.rb index 389dcbac7..331b49048 100644 --- a/lib/google/api_client/reference.rb +++ b/lib/google/api_client/reference.rb @@ -64,7 +64,7 @@ module Google self.headers = options[:headers] || {} if options[:media] self.media = options[:media] - upload_type = parameters['uploadType'] || parameters['upload_type'] + upload_type = self.parameters.find { |(k, _)| ['uploadType', 'upload_type'].include?(k) }.last case upload_type when "media" if options[:body] || options[:body_object]