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


Performs a POST web request synchronously.

Parameters


url

string

The URL to request.

body

string

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.