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:

  1. table JSON-decoded response body
  2. number HTTP status code
lua-repl.lib.rest:patch (url, data)
Sends PATCH request to URL and parse the response as JSON.

Parameters:

  • url string URL
  • data table Payload. Will be encoded to JSON before sending.

Returns:

  1. table JSON-decoded response body
  2. number HTTP status code
lua-repl.lib.rest:post (url, data)
Sends POST request to URL and parse the response as JSON.

Parameters:

  • url string URL
  • data table Payload. Will be encoded to JSON before sending.

Returns:

  1. table JSON-decoded response body
  2. number HTTP status code
generated by LDoc 1.4.6 Last updated 1980-01-01 00:00:00