Code: Select all
$ wget --tries=1 -S -v --delete-after "http://127.0.0.1:8080/sabnzbd/api?mode=shutdown"; echo "RET = $?"
--20:35:33-- http://127.0.0.1:8080/sabnzbd/api?mode=shutdown
=> `api?mode=shutdown'
Connecting to 127.0.0.1:8080... connected.
HTTP request sent, awaiting response... No data received.
Giving up.
RET = 1
In addition, sending bogus stuff via the api (?mode=foobar) results in replies (and thus wget return values) indicating success which, although not currently a real issue, is probably not the best thing either if this api gets more complex in the future.
And lastly, sending unneccessary extra parameters like a username and password while the web interface doesn't have these set, causes an "internal error" rather than something a bit more descriptive or even success:
Code: Select all
$ wget --tries=1 -S -v --delete-after "http://127.0.0.1:8080/sabnzbd/api?mode=shutdown&ma_username=user&ma_password=pass"; echo "RET = $?"
--20:50:15-- http://127.0.0.1:8080/sabnzbd/api?mode=shutdown&ma_username=user&ma_password=pass
=> `api?mode=shutdown&ma_username=user&ma_password=pass'
Connecting to 127.0.0.1:8080... connected.
HTTP request sent, awaiting response...
500 Internal error
Date: Sat, 16 Aug 2008 18:50:15 GMT
Server: CherryPy/2.2.1
Content-Type: text/html
Set-Cookie: session_id=efb2e75f082671d674a425e67805290b0f4b4695; expires=Sat, 16-Aug-2008 19:50:15 GMT; Path=/
20:50:15 ERROR 500: Internal error.
RET = 1