Method: Parse::API::Files#create_file
- Defined in:
- lib/parse/api/files.rb
#create_file(fileName, data = {}, content_type = nil) ⇒ Parse::Response
Upload and create a Parse file.
20 21 22 23 24 25 26 |
# File 'lib/parse/api/files.rb', line 20 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 |