Google reCAPTCHA, 405 error and CORS issue
<p>I am using AngularJS and trying to work with Google's reCAPTCHA,
I am using the "<strong>Explicitly render the reCAPTCHA widget</strong>" method for displaying the reCAPTCHA on my web page,</p>

<p><strong>HTML code -</strong> </p>

<pre><code>&lt;script type="text/javascript"&gt;
    var onloadCallback = function() 
    {
        grecaptcha.render('loginCapcha', {
            'sitekey' : 'someSiteKey',
            'callback' : verifyCallback,
            'theme':'dark'

        });
    };

    var auth='';
    var verifyCallback = function(response) 
    {
       //storing the Google response in a Global js variable auth, to be used in the controller
        auth = response;

        var scope = angular.element(document.getElementById('loginCapcha')).scope();
        scope.auth();
    };
&lt;/script&gt;

&lt;div id="loginCapcha"&gt;&lt;/div&gt;


&lt;script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&amp;render=explicit" async defer&gt;&lt;/script&gt;
</code></pre>

<p>So far, I am able to achieve the needed functionality of whether the user is a Human or a Bot,<br/>
As per my code above, I have a <strong>Callback function called 'verifyCallback'</strong> in my code,<br/>
which is <strong>storing the response created by Google</strong>, in a global variable called 'auth'.<br/><br/>
Now, the final part of reCAPCHA is calling the Google API,<br/> with "<strong><a href="https://www.google.com/recaptcha/api/siteverify" rel="nofollow noreferrer">https://www.google.com/recaptcha/api/siteverify</a></strong>" as the URL and using a <strong>POST</strong> method,<br/>And passing it the <strong>Secret Key</strong> and the <strong>Response</strong> created by Google, which I've done in the code below. </p>

<p><strong>My Controller -</strong></p>

<pre><code>_myApp.controller('loginController',['$rootScope','$scope','$http',
 function($rootScope,$scope,$http){

    var verified = '';

    $scope.auth = function()
    {
        //Secret key provided by Google
        secret = "someSecretKey";

       /*calling the Google API, passing it the Secretkey and Response,
       to the specified URL, using POST method*/

        var verificationReq = {

            method: 'POST',
            url: 'https://www.google.com/recaptcha/api/siteverify',
            headers: {
                 'Access-Control-Allow-Origin':'*'
             },
            params:{
                secret: secret,
                response: auth
            }

        }


        $http(verificationReq).then(function(response) 
        {
            if(response.data.success==true)
            {
                console.log("Not a Bot");
                verified = true;
            }
            else
            {
                console.log("Bot or some problem");
            }

        }, function() {
           // do on response failure
        });
    }
</code></pre>

<p>So, the Problem I am actually facing is that I am unable to hit the Google's URL,<br/> Following is the screenshot of the request I am sending and the error.<br/></p>

<p><strong>Request made -</strong><br/>
<a href="https://i.stack.imgur.com/bWToc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bWToc.jpg" alt="enter image description here"></a></p>

<p><strong>Error Response -</strong>
<a href="https://i.stack.imgur.com/XOV41.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XOV41.jpg" alt="enter image description here"></a> </p>

<p><strong>As far as I understand it is related to CORS and Preflight request</strong>.<br/>So what am I doing wrong? How do I fix this problem?</p>