Commit 5416d643 authored by okhin's avatar okhin

Merge branch '1-the-api-php-isn-t-working' into 'master'

We want to follow the 302 and the likes, also enforcing json content-type.

Closes #1

See merge request !1
parents dac45805 98811ef7
......@@ -9,8 +9,9 @@ class Api {
$curl = curl_init();
$url = API_BASE . $url . "/?format=json";
curl_setopt($curl, CURLOPT_URL, $url);
//curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($curl);
curl_close($curl);
return $result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment