HttpQuery

HttpQuery

new HttpQuery(url)

Description:
  • Low-level HTTP POST query interface with the server service.

    • This is the client side of a simple client/server service mechanism.
Parameters:
Name Type Description
url string

The server URL, including the service port.

Methods

send(query, callbackopt, timeout)

Description:
  • Returns the server response, if activated.

Parameters:
Name Type Attributes Default Description
query string

The server query as a string, of the form name=value&....

callback callback <optional>
function(value){}

The callback that handles the query return value.

  • Runs the callback(value: string) function with the query answer.
  • If the server is not running, a JavaScript alert is raised to ask the user to run it.
  • If the query is invalid or not implemented, the callback value is the empty string, without any further information.
timeout unit

The query timeout in millisecond, 0 means no timeout.

  • When timeout is triggered the callback is called with the { "timeout": true } value.
  • Timeout is not considered as an error.