When using php to access the root directory using /server/directory/. (which is stated on http://scales.pufferpanel.com/docs/serverdirectorydirectory to list the base files) it throws the following error:
Response HTTP Status Code : 405 Response HTTP Body : {"code":"MethodNotAllowedError","message":"GET is not allowed"}
I am able to access other directories such as /server/directory/logs which outputs:
Response HTTP Status Code : 200 Response HTTP Body : [SUPER LONG ARRAY OF FILES]
The code I'm using is as follows:
<?php
$XAccessServer = "KEY";
$XAccessToken = "KEY";
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, 'https://URL:5656/server/directory/.');
curl_setopt($cURL, CURLOPT_CAINFO, getcwd()."\certs\https.pem"); /*Trusting a local copy of the self-signed cert*/
curl_setopt($cURL, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cURL, CURLOPT_HTTPHEADER, [
"X-Access-Server: $XAccessServer",
"X-Access-Token: $XAccessToken",
]
);
$data = curl_exec($cURL);
if(!$data) {
die('Error: "' . curl_error($cURL) . '" - Code: ' . curl_errno($cURL));
} else {
$data = json_decode($data);
echo "<pre>".print_r($data, true)."</pre>";
}
curl_close($cURL);
so if the error is in my code please correct me. The error only happens when using /directory/. even though this is documented to work.
When using php to access the root directory using /server/directory/. (which is stated on http://scales.pufferpanel.com/docs/serverdirectorydirectory to list the base files) it throws the following error:
Response HTTP Status Code : 405 Response HTTP Body : {"code":"MethodNotAllowedError","message":"GET is not allowed"}
I am able to access other directories such as /server/directory/logs which outputs:
Response HTTP Status Code : 200 Response HTTP Body : [SUPER LONG ARRAY OF FILES]
The code I'm using is as follows:
so if the error is in my code please correct me. The error only happens when using /directory/. even though this is documented to work.