blob: b2c244beea2f7804465c26f3ac24a9519a41c170 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
include_once("aurjson.class.php");
if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
header('HTTP/1.1 405 Method Not Allowed');
exit();
}
if ( isset($_GET['type']) ) {
$rpc_o = new AurJSON();
echo $rpc_o->handle($_GET);
}
else {
// dump a simple usage output for people to use.
// this could be moved to an api doc in the future, or generated from
// the AurJSON class directly with phpdoc. For now though, just putting it
// here.
?>
<html><body>
The methods currently allowed are: <br />
<ul>
<li>search</li>
<li>info</li>
<li>multiinfo</li>
<li>msearch</li>
</ul> <br />
Each method requires the following HTTP GET syntax: <br />
type=<i>methodname</i>&arg=<i>data</i>
<br /><br />
Where <i>methodname</i> is the name of an allowed method, and <i>data</i> is the argument to the call.
<br /><br />
If you need jsonp type callback specification, you can provide an additional variable <i>callback</i>.
<br />
Example URL: <br />
http://aur-url/rpc.php?type=search&arg=foobar&callback=jsonp1192244621103
</body></html>
<?php
// close if statement
}
?>
|