xml-rpc only accept POST request
Posted: Tue Nov 08, 2016 4:05 pm
Dear testlink admin and dear developpers,
As we are finally upgrading our testlink from 1.9.5 to 1.9.14 I am testing if our TCL scripts using testlink xml-rpc API are still working as expected with this new version.
All seems fine with the configuration :
-I get "XML-RPC server accepts POST requests only." when I open the page https://mytestlinkserver/lib/api/xmlrpc/v1/xmlrpc.php in my browser
-Both checkdevkey (../lib/api/xmlrpc/v1/sample_clients/php/clientCheckDevKey.php) and another method, for instance getprojectbyname (lib/api/xmlrpc/v1/sample_clients/php/clientGetTestProjectByName.php) pages gives a positive result.
But when I try the same requests in line command with CURL they don't work and I aklways get the "XML-RPC server accepts POST requests only." error message.
Example:
curl http://mytestlinkserver/lib/api/xmlrpc/v1/xmlrpc.php -X POST -d "<?xml version="1.0"?><methodCall><methodName>tl.checkDevKey</methodName><params><param><value><struct><member><name>devKey</name><value><string>436dfe9711456fab2334373418c93ddc</string></value></member></struct></value></param></params></methodCall>"
As explained the first request that my TCL script is doing is
curl http://mytestlinkserver/lib/api/xmlrpc.php -X POST -d "<?xml version="1.0"?><methodCall><methodName>tl.getTestProjectByName</methodName><params><param><value><struct><member><name>devKey</name><value><string>MY DEVKEY</string></value></member><member><name>testprojectname</name><value><string>MY PROJECT</string></value></member></struct></value></param></params></methodCall>"
and in the script the request gets a timeout.
This is why I am trying to test it with curl command.
PS : the xml-rpc examples only work in http while we login in https mode.
Am I missing something why it does not work within the script or by curl but the examples with the same format are working fine?
Thank you a lot in advance for your help !
As we are finally upgrading our testlink from 1.9.5 to 1.9.14 I am testing if our TCL scripts using testlink xml-rpc API are still working as expected with this new version.
All seems fine with the configuration :
-I get "XML-RPC server accepts POST requests only." when I open the page https://mytestlinkserver/lib/api/xmlrpc/v1/xmlrpc.php in my browser
-Both checkdevkey (../lib/api/xmlrpc/v1/sample_clients/php/clientCheckDevKey.php) and another method, for instance getprojectbyname (lib/api/xmlrpc/v1/sample_clients/php/clientGetTestProjectByName.php) pages gives a positive result.
But when I try the same requests in line command with CURL they don't work and I aklways get the "XML-RPC server accepts POST requests only." error message.
Example:
curl http://mytestlinkserver/lib/api/xmlrpc/v1/xmlrpc.php -X POST -d "<?xml version="1.0"?><methodCall><methodName>tl.checkDevKey</methodName><params><param><value><struct><member><name>devKey</name><value><string>436dfe9711456fab2334373418c93ddc</string></value></member></struct></value></param></params></methodCall>"
As explained the first request that my TCL script is doing is
curl http://mytestlinkserver/lib/api/xmlrpc.php -X POST -d "<?xml version="1.0"?><methodCall><methodName>tl.getTestProjectByName</methodName><params><param><value><struct><member><name>devKey</name><value><string>MY DEVKEY</string></value></member><member><name>testprojectname</name><value><string>MY PROJECT</string></value></member></struct></value></param></params></methodCall>"
and in the script the request gets a timeout.
This is why I am trying to test it with curl command.
PS : the xml-rpc examples only work in http while we login in https mode.
Am I missing something why it does not work within the script or by curl but the examples with the same format are working fine?
Thank you a lot in advance for your help !