Method: Base::Endpoints::Files#create
- Defined in:
- lib/base/endpoints/files.rb
#create(path:, type:, filename:) ⇒ Object
Uploads the given file and returns its metadata.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/base/endpoints/files.rb', line 24 def create(path:, type:, filename:) request do io = Faraday::UploadIO.new(path, type, filename) response = connection.post('', 'file' => io) parse(response.body) end end |