I have the XMPP-server openfire. Also i have added the "rest api plugin" and tested it with the Chrome Tool "Postman", and it works fine.
Request:
http://myhost.net:9090/plugins/restapi/v1/users
Header:
Authorization:myPasswort
Result:
{
"user": [
{
"username": "admin",
"name": "Administrator",
"email": "[email protected]",
"properties": null
},
...
Now i want to use the result in a my composer app from appgyver.com. Same input, but always the server result:
Response code: 500. {"error":"Internal server error."}
Then i try a get request with a php script:
$url = "myhost.net/plugins/restapi/v1/users";
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'Authorization' => 'myPasswort'
),
);
$context = stream_context_create($options);
var_dump($http_response_header);
echo "\r\n";
$result = file_get_contents($url, false, $context);
var_dump($result);
with the result: NULL bool(false)
What i doing wrong? Thanks