Module: Parse::API::Files
- Included in:
- Client
- Defined in:
- lib/parse/api/files.rb
Overview
Defines the Parse Files interface for the Parse REST API
Instance Method Summary collapse
- #create_file(fileName, data = {}, content_type = nil) ⇒ Parse::Response
Upload and create a Parse file.
Instance Method Details
#create_file(fileName, data = {}, content_type = nil) ⇒ Parse::Response
Upload and create a Parse file.
19 20 21 22 23 24 25 | # File 'lib/parse/api/files.rb', line 19 def create_file(fileName, data = {}, content_type = nil) headers = {} headers.merge!({ Parse::Protocol::CONTENT_TYPE => content_type.to_s }) if content_type.present? response = request :post, "#{FILES_PATH}/#{fileName}", body: data, headers: headers response.parse_class = Parse::Model::TYPE_FILE response end |