Stack Exchange API で cURL を使用しようとしていますが、null 応答が返されたようです。何が起こっているのかについてのアイデアはありますか?
私のコードは次のとおりです。
function get($get){
$ch = curl_init("http://api.stackoverflow.com/1.1/search?intitle=meteor");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_ENCODING , "gzip");
$decoded = json_decode(curl_exec($ch), true);
var_dump($decoded->questions[0]->title);
}
get("stackoverflow");