Unable to suspend/unsuspend with API (Cannot Execute Command Empty post)

KuJoe

New member
Joined
May 6, 2019
Messages
2
I'm running into the same issue as everybody else has been experiencing for the past few years or so and I'm hoping it's been fixed now but I'm worried it hasn't been. I'm using the following web pages for reference without any luck:

https://www.directadmin.com/api.php
https://www.directadmin.com/features.php?id=807
http://files.directadmin.com/services/all/httpsocket/examples/example.suspend_user.php

When I use "CMD_API_SELECT_USERS" I get the error:

Cannot Execute Command Empty post

When I use "CMD_SELECT_USERS" I get this error:


If I visit that link directly it does suspend the service though. I'm able to use the HTTPSocket PHP class to create accounts fine but unable to figure out how to suspend/unsuspend. Any help is appreciated. Thanks.
 
This has been resolved. I didn't realize that the HTTPSocket script used GET by default, switching this to POST allows me to use CMD_API_SELECT_USERS without issue.

For others who run into this issue, edit the httpsocket.php file like so:

Find:
Code:
var $method = 'GET';

Replace:
Code:
var $method = 'POST';

I must have been really tired this morning to miss something so simple. :D
 
Back
Top