Anhskohbo\NoCaptcha\NoCaptcha::sendRequestVerify PHP Method

sendRequestVerify() protected method

Send verify request.
protected sendRequestVerify ( array $query = [] ) : array
$query array
return array
    protected function sendRequestVerify(array $query = [])
    {
        // This taken from: https://github.com/google/recaptcha/blob/master/src/ReCaptcha/RequestMethod/Post.php
        $peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name';
        $context = stream_context_create(array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($query, '', '&'), 'verify_peer' => true, $peer_key => 'www.google.com')));
        $response = file_get_contents(static::VERIFY_URL, false, $context);
        return json_decode($response, true);
    }