Developer_release_1.4.0
Class lua-repl.lib.rest
REST tools.
Methods
lua-repl.lib.rest:get (url[, timeout=socket.TIMEOUT[, raw=false]]) | Sends GET request to URL and parse the response as JSON. |
lua-repl.lib.rest:patch (url, data) | Sends PATCH request to URL and parse the response as JSON. |
lua-repl.lib.rest:post (url, data) | Sends POST request to URL and parse the response as JSON. |
Methods
- lua-repl.lib.rest:get (url[, timeout=socket.TIMEOUT[, raw=false]])
-
Sends GET request to URL and parse the response as JSON.
Parameters:
- url string URL
- timeout number Custom timeout, seconds (default socket.TIMEOUT)
- raw boolean Don't decode the body if set (default false)
Returns:
- table JSON-decoded response body
- number HTTP status code
- lua-repl.lib.rest:patch (url, data)
-
Sends PATCH request to URL and parse the response as JSON.
Parameters:
Returns:
- table JSON-decoded response body
- number HTTP status code
- lua-repl.lib.rest:post (url, data)
-
Sends POST request to URL and parse the response as JSON.
Parameters:
Returns:
- table JSON-decoded response body
- number HTTP status code