O'Reilly logo

Learning AngularJS by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sending HTTP GET and PUT Requests with the $http Service

The $http service enables you to directly interact with the web server from your AngularJS code. The $http service uses the browser’s XMLHttpRequest object underneath, but from the context of the AngularJS framework.

There are two ways to use the $http service. The simplest is to use one of the following built-in shortcut methods that correspond to standard HTTP requests:

delete(url, [config])

get(url, [config])

head(url, [config])

jsonp(url, [config])

post(url, data, [config])

put(url, data, [config])

patch(url, data, [config])

Configuring the $http Request

In these methods, the url parameter is the URL of the web request. The optional config parameter is a JavaScript object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required