class Google::Apis::Core::MultipartUploadCommand

Implementation of the multipart upload protocol

Constants

MULTIPART_PROTOCOL

Public Instance Methods

prepare!() click to toggle source

Encode the multipart request

@return [void] @raise [Google::Apis::ClientError] if upload source is invalid

# File lib/google/apis/core/upload.rb, line 107
def prepare!
  super
  multipart = Multipart.new
  multipart.add_json(body)
  multipart.add_upload(upload_io, content_type: upload_content_type)
  self.body = multipart.assemble
  header['Content-Type'] = multipart.content_type
  header[UPLOAD_PROTOCOL_HEADER] = MULTIPART_PROTOCOL
end