Joe's Blog

line

A blog by Joe Billman about programming, and other stuff

line

Archive for the ‘AngularJS’ Category

RESTful calls via AngularJS

Posted on: November 5th, 2014 by Joe

line No Comments

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);
    });


Warning: Use of undefined constant Y - assumed 'Y' (this will throw an Error in a future version of PHP) in /homepages/16/d145171736/htdocs/php/footer.php on line 1