unirest-gdscript icon indicating copy to clipboard operation
unirest-gdscript copied to clipboard

Support automatic File uploading on MultipartRequest

Open fenix-hub opened this issue 3 years ago • 0 comments

Multipart requests are generally used to post files along with data. The MultipartRequest class could support file uploading through a couple of methods:

func field(name: String, filecontent: PoolByteArray, filename: String) -> ..
# requires the file content to be extracted through the File class
# 'Content-Disposition: form-data; name="<field>"; filename="<filename>"'
# <filecontent>

func field(name: String, filepath: String) -> ...
# this will automatically open and handle file content
# using File class internally.
# eventually for large files threads could be used
# progression could also be supported
# the name of the file will be extracted by the filepath

fenix-hub avatar Aug 08 '22 14:08 fenix-hub