Calling Nomination Nominatim with file_get_contents ..
I used in a PHP script to call the Nominativ API with file____get____contents. This worked excellently until 13.09.2017.
I have tried CURL but no result or error returns.
function file_get_contents_curl($cmd, $query) {
$level=error_reporting();
error_reporting(E_ALL);
$ch = curl_init();
$query= curl_escape($ch,$query);
$url = $cmd.$query;
echo $url.' <--';
curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
//Set curl to return the data instead of printing it to the $
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 3);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$data = curl_exec($ch);
curl_close($ch);
error_reporting($level);
return $data;
}
/*result of echo
http://nominatim.openstreetmap.org/search?format=json&limit=1&addressdetails=1%26email%3Dg%40example.com%26street%3D19%2BAhornweg%26city%3DKoenigswinter%26country%3DDeutschland%26postalcode%3D53639
*/
Can anyone help me with a working solution?