Hi Guest 1 HomePage 1 Jobs 1 WalkIn 1Articles  

 :) Latest Topic
Numbers And Strings
Objects And Array
AngularJS VS JavaScript
Controllers in Files
Load the Library
AngularJS Directives
Repeating Directive
AngularJS Facts
Create Directives
Restrict Directive
Custom Filter
AngularJS Services
AngularJS Service 2
AngularJS Tables
Select Option
Select Option 2
AngularJS Forms
Form Validation
Validation CSS
Validation Example
AngularJS API
AngularJS $http
AngularJS Database
AngularJS HTML DOM
AngularJS Events
Custom Validation
AngularJS Tutorial
AngularJS Introduction
Angular init Directive
AngularJS Expressions 1
AngularJS Applications
AngularJS Expressions 2
Angular CSS Properties
AngularJS JSON
AngularJS Modules
Controller Basic
Add a Directive
Model Directive
Validate Inputs
CSS Classes
Data Binding
AngularJS Controller
AngularJS Scope
Root of Scope
AngularJS Filters
 


  

 
AngularJS $http
Question Posted on 19 Apr 2020

Home >> Tutorial >> AngularJS >> AngularJS $http


AngularJS $http
We use $http as a service to read data from remote servers. From AngularJS $http we make a request to the server and returns a response. Below is the example of $http request response model.


AngularJS Http Service
Methods
In above example we uses the .get method of $http service. And .get method is a

shortcut method of $http service. Below are the example of different shortcut methods
(i).delete()
(ii).get()
(iii).head()
(iv).jsonp()
(v).patch()
(vi).post()
(vii).put()
Above all methods are shortcuts of calling the $http service.

AngularJS Http Method
In above example it execute the $http service with an object as an argument. And object is specifying the HTTP method , URL and sucess and failure operation details.

Properties
The response we get from server is an object with these below properties:
(1).config:- the object used to generate the request.
(2).data:- it could be a string, or an object, carrying the response from the server.
(3).headers:- a function to use to get header information.
(4).status:- a number defining the HTTP status.
(5).statusText:- a string defining the HTTP status.
Below example will helps you get response with above properties.



AngularJS Http Properties
To handle this errors we will add one more functions to the .then method


AngularJS Http Then





Other Important Questions
Numbers And Strings
Objects And Array
AngularJS VS JavaScript
Controllers in Files
Load the Library







 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |