Sha256: 3a93f65bb3f93c964521d403e4608beed62d468505da7a903c77cb4cf4c638b3
Contents?: true
Size: 864 Bytes
Versions: 18
Compression:
Stored size: 864 Bytes
Contents
module DropboxApi::Endpoints class ContentDownload < 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) body = nil headers = { 'Dropbox-API-Arg' => JSON.dump(params), 'Content-Type' => '' } return body, headers end def perform_request(params) response = get_response(params) api_result = process_response response # TODO: Stream response, current implementation will fail with very large # files. yield response.body if block_given? api_result end end end # TODO: # 1. Combine ContentDownload and ContentUpload to share its initialize method. # 2. Reorganize the methods which create the request.
Version data entries
18 entries across 18 versions & 1 rubygems