src/ReCaptcha/RequestMethod/CurlPost.php
public function submit(RequestParameters $params)
    {
        $handle = $this->curl->init($this->siteVerifyUrl);

        $options = array(
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => $params->toQueryString(),
            CURLOPT_HTTPHEADER => array(
                'Content-Type: application/x-www-form-urlencoded'
            ),
            CURLINFO_HEADER_OUT => false,
            CURLOPT_HEADER => false,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => true
        );
        $this->curl->setoptArray($handle, $options);

        $response = $this->curl->exec($handle);
        $this->curl->close($handle);

        if ($response !== false) {
            return $response;
        }

        return '{"success": false, "error-codes": ["'.ReCaptcha::E_CONNECTION_FAILED.'"]}';
    }
public function submit(RequestParameters $params)
    {
        $handle = $this->curl->init($this->siteVerifyUrl);

        $options = array(
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => $params->toQueryString(),
            CURLOPT_HTTPHEADER => array(
                'Content-Type: application/x-www-form-urlencoded'
            ),
            CURLINFO_HEADER_OUT => false,
            CURLOPT_HEADER => false,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => true
        );
        $this->curl->setoptArray($handle, $options);

        $response = $this->curl->exec($handle);
        $this->curl->close($handle);

        if ($response !== false) {
            return $response;
        }

        return '{"success": false, "error-codes": ["'.ReCaptcha::E_CONNECTION_FAILED.'"]}';
    }
public function submit ( RequestParameters $ params ) { $ handle = $ this -> curl -> init ( $ this -> siteVerifyUrl ) ; $ options = array ( CURLOPT_POST => true , CURLOPT_POSTFIELDS => $ params -> toQueryString ( ) , CURLOPT_HTTPHEADER => array ( 'Content-Type: application/x-www-form-urlencoded' ) , CURLINFO_HEADER_OUT => false , CURLOPT_HEADER => false , CURLOPT_RETURNTRANSFER => true , CURLOPT_SSL_VERIFYPEER => true ) ; $ this -> curl -> setoptArray ( $ handle , $ options ) ; $ response = $ this -> curl -> exec ( $ handle ) ; $ this -> curl -> close ( $ handle ) ; if ( $ response !== false ) { return $ response ; } return '{"success": false, "error-codes": ["' . ReCaptcha :: E_CONNECTION_FAILED . '"]}' ; }
Submit the cURL request with the specified parameters.

@param RequestParameters $params Request parameters
@return string Body of the reCAPTCHA response
Submit the cURL request with the specified parameters .