Functions for performing HTTP and HTTPS requests.
Static methods
staticrequest<T>(url:String, method:String, callback:(T, Hash, HttpResponse) ‑> Void, ?headers:Table<String, String>, ?post_data:String, ?options:HttpOptions):Void
Perform a HTTP/HTTPS request.
The following cipher suites are supported for HTTPS requests:
- TLS_RSA_WITH_AES_128_CBC_SHA
- TLS_RSA_WITH_AES_256_CBC_SHA
- TLS_RSA_WITH_AES_128_CBC_SHA256
- TLS_RSA_WITH_AES_256_CBC_SHA256
If no timeout value is passed, the configuration value "network.http_timeout" is used. If that is not set, the timeout value is 0. (0 == blocks indefinitely)
Parameters:
url | target url |
---|---|
method | HTTP/HTTPS method, e.g. GET/PUT/POST/DELETE/... |
callback | response callback |
headers | optional lua-table with custom headers |
post_data | optional data to send |
options | optional lua-table with request parameters |