RESTful calls via AngularJS

I’ve been doing more with AngularJS lately, it’s becoming really popular. Here’s how to do RESTful calls with Angular:

var config = {headers:{'accept': 'application/json',
    'content-type': 'application/json;charset=UTF-8'}};
    
$http.post(url, data, config).
    success(function(response)
    {
        successHandler(response);
    }).
    error(function(response)
    {
        errorHandler(response);
    });

Leave a Reply

Your email address will not be published. Required fields are marked *