"value1", "clave" => "value2", ); try{ $curl = curl_init(); $curl_options = array( CURLOPT_URL => $API_URL . "?" . http_build_query($parametros), CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPGET => true, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( "Content-Type: application/json" ) ); curl_setopt_array($curl, $curl_options); $response = json_decode(curl_exec($curl), true); if ($response[0]) { header("Location: " . $URL_REDIRECT_TRUE); } else{ header("Location: " . $URL_REDIRECT_FALSE); } } catch (Exception $e){ echo "Error: $e." . PHP_EOL; }