This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends HTTPRequest | |
class_name HTTPFilePost | |
func post_file(url: String, field_name: String, file_name: String, file_path: String, post_fields: Dictionary = {}, content_type: String = "", custom_headers: Array = [], verify_ssl: bool = true): | |
var file = File.new() | |
file.open(file_path) | |
var content = file.get_buffer(file.get_len()) | |
file.close() | |
post_data_as_file(url, field_name, file_name, content, post_fields, content_type, custom_headers, verify_ssl) | |