summaryrefslogtreecommitdiffstats
path: root/web/html/rpc.php
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2007-10-13 12:27:35 -0700
committerDan McGee <dan@archlinux.org>2008-01-19 23:49:35 -0600
commit36dd7736c993cbcf61228f6e06466a6614939c97 (patch)
tree734bf633c46da10155bff6e8cb806c31e5493be7 /web/html/rpc.php
parent5e38e3d3d0eff20f8d46bad67c4944a6a1d92ea4 (diff)
downloadaurweb-36dd7736c993cbcf61228f6e06466a6614939c97.tar.xz
Moved usage documentation out of the class.
Fixed an issue in the handle class.
Diffstat (limited to 'web/html/rpc.php')
-rw-r--r--web/html/rpc.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/web/html/rpc.php b/web/html/rpc.php
index 3081391..033cba5 100644
--- a/web/html/rpc.php
+++ b/web/html/rpc.php
@@ -10,9 +10,22 @@ if ( $_SERVER['REQUEST_METHOD'] == 'GET' ) {
if ( isset($_GET['type']) ) {
echo $rpc_o->handle($_GET);
}
- else {
+ 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.
echo '<html><body>';
- echo $rpc_o->usage();
+ echo 'The methods currently allowed are: <br />';
+ echo '<ul>';
+ echo '<li>search</li>';
+ echo '<li>info</li>';
+ echo '</ul><br />';
+ echo 'Each method requires the following HTTP GET syntax:<br />';
+ echo '&nbsp;&nbsp; type=<i>methodname</i>&arg=<i>data</i> <br /><br />';
+ echo 'Where <i>methodname</i> is the name of an allowed method, and <i>data</i> is the argument to the call.<br />';
+ echo '<br />';
+ echo 'If you need jsonp type callback specification, you can provide an additional variable <i>callback</i>.<br />';
+ echo 'Example URL: <br />&nbsp;&nbsp; http://aur-url/rpc.php?type=search&arg=foobar&callback=jsonp1192244621103';
echo '</body></html>';
}
}