Reputation: 3194
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
Reputation: 5700
That API endpoint takes a POST request and you are sending a GET request.
Upvotes: 2