+ Performs an HTTP request.
+ Usage example:
+
+NETWORK:HttpRequest{
+ url="https://api.example.com",
+ method="GET", -- default: "GET"
+ body="", -- default: ""
+ multipartBoundary="", -- default: ""
+ headers={ -- default: {}
+ ["Accept-Language"]="en-US",
+ ["Cookie"]="sessionId=42",
+ },
+ connectTimeout=3, -- default: 60
+ transferTimeout=10, -- default: 1800
+ onResponse=function(response) -- default: no callback
+ ...
+ end,
+}
+
+ Everything but url is optional. Supported methods are GET, POST, PUT, PATCH, DELETE and HEAD.
+ A response looks like this:
+
+{
+ statusCode=200,
+ headers={
+ ["Content-Type"]="application/json",
+ ["Cache-Control"]="max-age=172800",
+ ["Server"]="Apache",
+ },
+ body="{...}"
+ uploadSize=204,
+ downloadSize=216,
+}
+
+ In case of an error the callback is called with a structure like this:
+
+{
+ error="HttpErrorCode_Blocked",
+ errorMessage="access to https://api.example.com is not allowed",
+}
+
+
+