<html>
<head>
<title>sample</title>
<?php
function http_post ($url, $data)
{
use key ‚http‘ even if you send the request to https://./..
$options = array(
‚http‘ ⇒ array(
‚header‘ ⇒ “Content-type: application/x-www-form-urlencoded\r\n”,
‚method‘ ⇒ ‚POST‘,
‚content‘ ⇒ http_build_query($data,“,’&‘),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
return $result;
}
$url = “https: control.hornetsecurity.com/api/GetAuthKey”;
$data = array(‚username‘ ⇒ ‚partner‘,’password‘ ⇒ ’secret‘, ‚loginname‘ ⇒ ‚customer.de‘,’response‘ ⇒ ‚plain‘);
$authkey = http_post($url,$data);
?>
</head>
<body>