Class: BrickFTP::RESTfulAPI::StartUpload
- Inherits:
-
Object
- Object
- BrickFTP::RESTfulAPI::StartUpload
- Includes:
- Command
- Defined in:
- lib/brick_ftp/restful_api/start_upload.rb
Overview
Starting a new upload
Instance Method Summary collapse
-
#call(path) ⇒ BrickFTP::Types::Upload
The first request to upload a new file is a POST request to /files/PATH_AND_FILENAME.EXT with an action parameter with the value of put.
Methods included from Command
Instance Method Details
#call(path) ⇒ BrickFTP::Types::Upload
The first request to upload a new file is a POST request to /files/PATH_AND_FILENAME.EXT with an action parameter with the value of put.
21 22 23 24 25 |
# File 'lib/brick_ftp/restful_api/start_upload.rb', line 21 def call(path) res = client.post("/api/rest/v1/files/#{ERB::Util.url_encode(path)}", action: 'put') BrickFTP::Types::Upload.new(**res.symbolize_keys) end |