You are here

public function Drupal6Post::submit in reCAPTCHA 6.2

Submit the POST request with the specified parameters.

Parameters

RequestParameters $params Request parameters:

Return value

string Body of the reCAPTCHA response

Overrides RequestMethod::submit

File

src/ReCaptcha/RequestMethod/Drupal6Post.php, line 30
Custom Drupal 6 RequestMehod class for Google reCAPTCHA library.

Class

Drupal6Post
Sends POST requests to the reCAPTCHA service.

Namespace

ReCaptcha\RequestMethod

Code

public function submit(RequestParameters $params) {
  $response = drupal_http_request(self::SITE_VERIFY_URL, array(
    'Content-type' => 'application/x-www-form-urlencoded',
  ), 'POST', $params
    ->toQueryString());
  return isset($response->data) ? $response->data : '';
}