concordia-server/cat/concordia_gate.php_pattern

27 lines
785 B
Plaintext
Raw Permalink Normal View History

2015-12-13 20:53:46 +01:00
<?php
2016-01-21 16:51:23 +01:00
$url = 'http://@concordia_host@:@concordia_port@';
$intervalsArray = array();
2019-01-22 14:32:25 +01:00
$data = array("operation" => $_POST["operation"],"tmId" => intval($_POST["tmId"]),"pattern" => $_POST["pattern"],"intervals" => $intervalsArray);
if(array_key_exists("limit", $_POST)) {
$data["limit"] = intval($_POST["limit"]);
}
if(array_key_exists("offset", $_POST)) {
$data["offset"] = intval($_POST["offset"]);
}
2015-12-13 20:53:46 +01:00
// 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' => json_encode($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
2017-02-21 11:51:47 +01:00
print $result;
2015-12-13 20:53:46 +01:00
?>