Overview

Namespaces

  • MatthiasMullie
    • Minify
      • Exceptions
    • PathConverter
  • None
  • ReCaptcha
    • RequestMethod
  • TOTP

Classes

  • Curl
  • CurlPost
  • Post
  • Socket
  • SocketPost
  • Overview
  • Namespace
  • Class

Class SocketPost

Sends a POST request to the reCAPTCHA service, but makes use of fsockopen() instead of get_file_contents(). This is to account for people who may be on servers where allow_furl_open is disabled.

ReCaptcha\RequestMethod\SocketPost implements ReCaptcha\RequestMethod
Namespace: ReCaptcha\RequestMethod
Located at Sources/ReCaptcha/RequestMethod/SocketPost.php
Methods summary
public
# __construct( ReCaptcha\RequestMethod\Socket $socket = null )

Constructor

Constructor

Parameters

$socket
optional socket, injectable for testing
public string
# submit( ReCaptcha\RequestParameters $params )

Submit the POST request with the specified parameters.

Submit the POST request with the specified parameters.

Parameters

$params
Request parameters

Returns

string
Body of the reCAPTCHA response

Implementation of

ReCaptcha\RequestMethod::submit()
Constants summary
string RECAPTCHA_HOST

reCAPTCHA service host.

reCAPTCHA service host.

Const

string
# 'www.google.com'
string SITE_VERIFY_PATH

Const

string reCAPTCHA service path
# '/recaptcha/api/siteverify'
string BAD_REQUEST

Const

string Bad request error
# '{"success": false, "error-codes": ["invalid-request"]}'
string BAD_RESPONSE

Const

string Bad response error
# '{"success": false, "error-codes": ["invalid-response"]}'
API documentation generated by ApiGen