I am using Google reCAPTCHA version 2, and have one question regarding number of hits on the captcha.
Is there any limitation on number of hits on passing or calling Google reCAPTCHA in a single minute or in 10 mins? For example, when we have huge load on the site and many users visited the contact us form and trying to pass the captcha at that time we are getting this error java.net.ConnectException: Connection timed out on this line
con.getOutputStream()During off hours the captcha works fine, but when we have too much load during peak hours at that time we are getting connection timed out error.
Any thoughts or suggestions would be much appreciated!
final String url = "https://www.google.com/recaptcha/api/siteverify";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
// add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String postParams = "secret=" + secret + "&response=" + gRecaptchaResponse;
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());//GETTING CONNECTION TIMED OUT ERROR ON THIS LINE
wr.writeBytes(postParams);
wr.flush();
wr.close();