zhekaus
zhekaus

Reputation: 3194

ReCaptcha returns 400 Bad Request during the verification

I’m trying to use Google’s reCaptcha and getting «400 Bad Request» during verification process. To communicate with Google I use Guzzle PHP HTTP client, like this:

$client = new GuzzleHttp\Client(['defaults' => ['verify' => false]]);
$res = $client->get('https://www.google.com/recaptcha/api/siteverify',
    ['body' => [
            'secret' =>  'my secret key',
            'response' => Input::get('g-recaptcha-response')
        ]]);

Does anybody know what I am doing wrong?

Upvotes: 2

Views: 7544

Answers (1)

Steve Buzonas
Steve Buzonas

Reputation: 5700

That API endpoint takes a POST request and you are sending a GET request.

Upvotes: 2

Related Questions