[HttpResponse]|[nil] response, [string] error = snetwork.postfile(url, filepathToBody, headers, method, progressCallback, files)


Performs a POST web request synchronously.

Parameters


url

string

The URL to request.

filepathToBody

string

The filepath containing the body of the request.

method

nil | "string | "OST | "UT | "ATCH

The HTTP method to use for the request.

progressCallback

nil | "fun(downloadDone:integer,

downloadTotal:integer, uploadDone:integer, uploadTotal:integer) A function which will be called whenever progress is made on the request.

files

HttpFileContent | "nil

A table of files to send with the request.

Return Value


response

HttpResponse | nil

The response from the server.

error

string

The error message if the request failed.