url http tylium com en gcc_chartdata gethistory data array Id ASDF Sym

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$url = 'http://tylium.com/en/gcc_chartdata/gethistory';
$data = array(
'Id' => 'ASDF',
'Symbol' => array(
'Symbol' => 'AAPL',
'Exchange' => 'NASDAQ'
),
'Periodicity' => 'h',
'Interval' => 1,
'BarsCount' => 5
);
// 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);
var_dump($result);