如何在角度$ http.post调用中添加额外数据?

时间:2015-07-22 20:02:25

标签: angularjs

在下面的函数中,在ValidateRecaptcha完成后,reCaptchaResponse为True,但是当我到达我的控制器时,它是一个空对象,所以我想发回reCaptchaResponse和$ http。发布...,但我不知道该怎么做。如果有错误,那很好,因为我只是返回错误。

    var insertCarbFormSubmission = function (carbForm) {
       return validateRecaptcha().then(
            function (reCaptchaResponse) {
                if (reCaptchaResponse === "True") {
                    return $http.post("http://localhost:59437/api/CarbFormSubmission/Post", carbForm);
                }
                return reCaptchaResponse;
            }
        );  
    };

0 个答案:

没有答案