Sha256: cebf7f73aeab130ee9cbe67f47a2195c970f51e8142e8d67ecd9100d772c0867

Contents?: true

Size: 708 Bytes

Versions: 8

Compression:

Stored size: 708 Bytes

Contents

module DropboxApi::Endpoints
  class ContentUpload < DropboxApi::Endpoints::Base
    def initialize(builder)
      @connection = builder.build("https://content.dropboxapi.com") do |c|
        c.response :decode_result
      end
    end

    def build_request(params, content)
      # TODO: It would be better to have a stream object on which we can call
      #       #read, rather than the full file content.
      body = content
      headers = {
        'Dropbox-API-Arg' => JSON.dump(params),
        'Content-Type' => 'application/octet-stream'
      }

      return body, headers
    end

    def perform_request(params, content)
      process_response(get_response(params, content))
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dropbox_api-0.1.8 lib/dropbox_api/endpoints/content_upload.rb
dropbox_api-0.1.7 lib/dropbox_api/endpoints/content_upload.rb
dropbox_api-0.1.6 lib/dropbox_api/endpoints/content_upload.rb
dropbox_api-0.1.5 lib/dropbox_api/endpoints/content_upload.rb
dropbox_api-0.1.4 lib/dropbox_api/endpoints/content_upload.rb
dropbox_api-0.1.3 lib/dropbox_api/endpoints/content_upload.rb
dropbox_api-0.1.1 lib/dropbox_api/endpoints/content_upload.rb
dropbox_api-0.1.0 lib/dropbox_api/endpoints/content_upload.rb