Class: DropboxApi::Endpoints::ContentUpload
- Inherits:
-
Base
- Object
- Base
- DropboxApi::Endpoints::ContentUpload
show all
- Defined in:
- lib/dropbox_api/endpoints/content_upload.rb
Instance Method Summary
collapse
Methods inherited from Base
add_endpoint, #initialize
Instance Method Details
#build_connection ⇒ Object
4
5
6
7
8
|
# File 'lib/dropbox_api/endpoints/content_upload.rb', line 4
def build_connection
@connection = @builder.build('https://content.dropboxapi.com') do |c|
c.response :decode_result
end
end
|
#build_request(params, body) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/dropbox_api/endpoints/content_upload.rb', line 10
def build_request(params, body)
= {
'Dropbox-API-Arg' => JSON.dump(params),
'Content-Type' => 'application/octet-stream'
}
content_length = get_content_length body
['Content-Length'] = content_length unless content_length.nil?
return body,
end
|
22
23
24
|
# File 'lib/dropbox_api/endpoints/content_upload.rb', line 22
def perform_request(params, content)
process_response(get_response(params, content))
end
|