client Class APE.Request

Summary

File
<./src/Ape_Jsf/Source/Request/Request.js>

Request Class Detail

APE.Request ()
Request object
File:
<./src/Ape_Jsf/Source/Request/Request.js>

Summary

Own
Methods Attributes Methods Name Methods Description
<static>   APE.Request. send (cmd, params, options) Send a command to the APE server

<static> {object} APE.Request. send (cmd, params, options)

Send a command to the APE server
Parameters:
{Array|string} cmd If the argument is a string, it should be a CMD (e.g. 'CONNECT'). If the argument is an array: the array should contain objects with cmd, params and sessid)
{object} params Optional The parameters that must be send with the command
{object} options Optional Object with request options
{boolean} options.sessid Optional Default: true Add the sessid property to the request
Returns:
{object} The request object or undefined in Opera browser
Examples
///ape var is a reference to APE instance
//Send a connect command to server
ape.request.send('JOIN', {"channels":"testChannel"});
//Note : you can join a channel with the method join
ape.join('testChannel');
//Note : testCommand is not a real APE command, it's just used here as an example
ape.request.send('testCommand', {"param1":"value","param2":"value"});
//ape var is a reference to APE instance
//This example sends a "JOIN" command,
// and "anotherCommand" with 2 arguments without adding sessid
ape.request.send(
	[
		{	"cmd":"JOIN", 				"params": { "channels": "test1"}},
		{	"cmd": "anotherCommand",	"params": { "param1": "value", "param2": "value" }, "sessid": false}
	]
);
See: