class Drupal6Post in reCAPTCHA 6.2
Sends POST requests to the reCAPTCHA service.
Hierarchy
- class \ReCaptcha\RequestMethod\Drupal6Post implements RequestMethod
Expanded class hierarchy of Drupal6Post
File
- src/
ReCaptcha/ RequestMethod/ Drupal6Post.php, line 16 - Custom Drupal 6 RequestMehod class for Google reCAPTCHA library.
Namespace
ReCaptcha\RequestMethodView source
class Drupal6Post implements RequestMethod {
/**
* URL to which requests are POSTed.
* @const string
*/
const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
/**
* Submit the POST request with the specified parameters.
*
* @param RequestParameters $params Request parameters
* @return string Body of the reCAPTCHA response
*/
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 : '';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Drupal6Post:: |
constant | URL to which requests are POSTed. @const string | ||
Drupal6Post:: |
public | function |
Submit the POST request with the specified parameters. Overrides RequestMethod:: |