Monday, 8 August 2016

javascript - How to call post method in Angularjs?

Hi I am developing Angularjs application. I am trying to call post method but i am not able to call post method.



Below is my code.



app.service("payementservice", function ($http) {
this.makepayment = function () {
debugger;
var validatesecretekeyData = {
merchant_email: "",//some data
secret_key: ""//somedata

};
var validatesecretekeyUrl = "https://www.paytabs.com/apiv2/validate_secret_key";
var responseservice = $http.post(validatesecretekeyUrl, validatesecretekeyData).success(function (response) {
});
return responseservice;
}
});


Please find the screenshot here. Post issue




In request header i can see Request Method:OPTIONS but i made POST request? May i know am i doing anything wrong? Any help would be appreciated. Thank you.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...