Hola este script me trabaja muy bien con el file_get_contents pero me interesa llevarlo a cur por la rapides de respuesta. He tratado con las diferentes opciones de context, pero por mas que le busco la vuelta no me trae el contenido del archivo remotos, me podrian hechar una mano para convertirlo en curl. Gracias
<?php
extension_loaded('openssl') or die('openssl');
$http['method'] = 'POST';
$http['header'] = 'Content-Type: application/json';
$http['content'] = <<<eof
{
"clientid": "lTGjFpjOIP8", "context": {
"client": {"clientName": "WEB", "clientVersion": "1.19700101"}
}
}
eof;
$con = stream_context_create(['http' => $http]);
$key = '?key=AIzaSyAO_F';
echo file_get_contents('https://www.server.com/'.$key,false, $con);
?>