pokusavam da dobijem json file kao response sa betfair.com stranice koji sadrzi utakmice i kvote... u njihovoj dokumentaciji mi stoji da sve saljem putem http post requesta.
na njihovoj stranici primjer je napisan u python-u
Code:
import requests
import json
endpoint = "https://beta-api.betfair.com/rest/v1.0/"
header = { 'X-Application' : 'APP_KEY_HERE', 'X-Authentication' : 'SESSION_TOKEN_HERE' ,'content-type' : 'application/json' }
json_req='{"filter":{ }}'
url = endpoint + "listEventTypes/"
response = requests.post(url, data=json_req, headers=header)
print json.dumps(json.loads(response.text), indent=3)
import requests
import json
endpoint = "https://beta-api.betfair.com/rest/v1.0/"
header = { 'X-Application' : 'APP_KEY_HERE', 'X-Authentication' : 'SESSION_TOKEN_HERE' ,'content-type' : 'application/json' }
json_req='{"filter":{ }}'
url = endpoint + "listEventTypes/"
response = requests.post(url, data=json_req, headers=header)
print json.dumps(json.loads(response.text), indent=3)
ja sam pokusao u phpu sljedecim kodom ali bezuspjesno
Code:
$url="https://beta-api.betfair.com/rest/v1.0/listEventTypes/";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_HEADER =>1,
CURLOPT_SSL_VERIFYPEER=>0,
CURLOPT_HTTPHEADER => array(
"X-Application" => $appKey
,"X-Authentication" => $token
,"Content-type" => 'application/json'
)
));
$file = curl_exec($curl);
$url="https://beta-api.betfair.com/rest/v1.0/listEventTypes/";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_HEADER =>1,
CURLOPT_SSL_VERIFYPEER=>0,
CURLOPT_HTTPHEADER => array(
"X-Application" => $appKey
,"X-Authentication" => $token
,"Content-type" => 'application/json'
)
));
$file = curl_exec($curl);
Bilo kakva pomoc ili komentar je dobrodosao..
Hvala, Denis
Samo Tari!!!