lundi 4 juillet 2016

How to consume Web API 2 ( $http post) method in Angular js

we can't able to consume web api2 method in angular js

module.exports = function ($http, utils) {
var self = this;
self.login = function (credentials) {
    var config = {
        headers: {
            //'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
            'Content-Type': 'application/json'
        }
    };

    return $http.post(utils.apiUrl('admin/login'), credentials, config); 

     };

};




Aucun commentaire:

Enregistrer un commentaire