Phil Phil - 5 months ago 8
AngularJS Question

Difference between $http.get and method:'GET'

I'm using Spring Data REST and have a MySQL DB to manage my data.
With AngularJS I programmed my first page and want to get data from my DB.

To get my data I know about two different ways:

$http.get('http://myURL')


and

$http({
method:'GET'
url:'http://myURL'
}


But where's the difference between them?

Thanks for help!

Answer

There is no difference, $http.get('http://myURL') is just a shortcut for $http({method:'GET, url:'http://myURL'}

Comments