request.send
(since )
Send a command to the APE server
Description
string
request.send
(
mixed cmd, [string params], [object options] )
Send a command to the APE server
All the request function are also available on a pipe object. When you use it on a pipe, the pipe pubid is added to the parameters sent to APE the server
Parameters
cmd
If the argument is a string :
- Command to send to APE server (eg : 'CONNECT') - ()
- An array with object containing cmd, params and sessid - ()
params
And object with params of the cmd
options
An object with request options :
- sessid - (boolean, optional) ; defaults to : true Add sessid to the request.
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"});
Sending multiple command in one time
//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
}
]);
User notes
# No comment
Post a note
CollaborAPE to our wiki !
Find the information you need on the APE Official Wiki : Install, Server, JSF, Help...
