Library http

Http library. Requests content from urls.

Functions

canRequest () Checks if a new http request can be started
get (url, callbackSuccess, callbackFail) Runs a new http GET request
post (url, params, callbackSuccess, callbackFail) Runs a new http POST request


Functions

http_library.canRequest ()
Checks if a new http request can be started
http_library.get (url, callbackSuccess, callbackFail)
Runs a new http GET request

Parameters:

  • url: http target url
  • callbackSuccess: the function to be called on request success, taking the arguments body (string), length (number), headers (table) and code (number)
  • callbackFail: the function to be called on request fail, taking the failing reason as an argument
http_library.post (url, params, callbackSuccess, callbackFail)
Runs a new http POST request

Parameters:

  • url: http target url
  • params: POST parameters to be sent
  • callbackSuccess: the function to be called on request success, taking the arguments body (string), length (number), headers (table) and code (number)
  • callbackFail: the function to be called on request fail, taking the failing reason as an argument

Valid XHTML 1.0!