Call Verify
to perform verify request ( https://developers.google.com/recaptcha/docs/verify#api_request ).
verifier := NewVerifier(&http.Client{})
resp, err := verifier.Verify(context.Background(), "secret", "token", "")
if err != nil {
return err
}
if !resp.Success {
return errors.New("you are bot")
}
verifier := NewVerifier(&http.Client{})
ctx, cancelFunc := context.WithTimeout(context.Background(), time.Second*10)
defer cancelFunc()
resp, err := verifier.Verify(ctx, "secret", "token", "")
if err != nil {
return err
}