AngularJS tag for $http service is a core Angular service that facilitates communication with the remote HTTP servers via the browser's XMLHttpRequest object or via JSONP.

learn more… | top users | synonyms

0
votes
0answers
22 views

Angular 2 Http Error - TS2346: Supplied parameter do not match any signature of call target

I have following Service, which doesn't work - but I don't get why. The Issue occurs at the return statements. I've tried everything I found so far. Do you have any clues? Service import {Injectable}...
0
votes
3answers
62 views

Cancelling an angular service promise

I have a controller that performs a http request. This request can take anywhere between 2 seconds to 4 minutes to return some data . I have added a button, that users should click to cancel the ...
2
votes
1answer
46 views

Get request is not fulfilling Angular-Express

I'm new to MEAN stack I want to have data fetch from express server (which I created with mongodb) when I click button, the function on button click was executed but request was not fulfilled, the ...
0
votes
4answers
39 views

how to call http call inside the for loop after success of before http call?

I want to call the api after completing the first is success.But in my code it call the api before the first one was completed for(var w=0;w<Ids.length;w++){ $scope.msgObject = { ...
131
votes
6answers
60k views

How to cancel an $http request in AngularJS?

Given a Ajax request in AngularJS $http.get("/backend/").success(callback); what is the most effective way to cancel that request if another request is launched (same backend, different parameters ...
0
votes
1answer
24 views

Can not add bearer token in $resource header

I am not able to add bearer token in $resource service header for token based authentication. I used following code Factory return $resource(appSettings.serverPath + "/api/product/:id", null, { ...
1
vote
1answer
36 views

Promise.all processes the promises in a group of 6 at each time [duplicate]

I wanna make a bunch of (let's say 20) HTTP POST requests (in order to send information of an app to some HTTP servers) simultaneously. I am using http angular service to return a promise: function ...
1
vote
0answers
18 views

laravel response status -1 on mobile

I'm developing an applicaiton using laravel 5.2, and using angular in some places on the front end. I'm always getting -1 as the response status for $http requests, when testing with mobile. The same ...
0
votes
2answers
255 views

switching between api and flat json in angularjs

I think my stackoverflow search-fu is broken today, because it can't be that I'm the only one who's ever asked this. Cripes, I hope not, because I could really use some help figuring this out. ...
1
vote
1answer
45 views

Angular 2 Http RetryWhen

I'm trying to use retryWhen in HTTP calls. It works perfectly when try to use like this: return this.http.get(`${environment.apiUrl}/track/${this.user.instance._id}/${this.currentPlayer.playlist.id}/...
14
votes
2answers
2k views

How to read JSON error response from $http if responseType is arraybuffer

I load some binary data using $http.post(url, data, { responseType: "arraybuffer" }).success( function (data) { /* */ }); In case of an error, the server responds with an error JSON ...
0
votes
1answer
33 views

Why Sending Params in Post Works like GET

I am Trying to make an http post request to .php file at the server all what i do is making the request like this $http({ url: 'http://localhost/sebha/login.php', method: '...
-1
votes
1answer
26 views

Angular 2 services subscribed twice [duplicate]

I just start first project with Angular 2 and I've trouble with services. I've an http service called when submitting a form, but when I submit the form, the http request is executed twice. login....
0
votes
1answer
16 views

Can't post data from Angular to my nodejs api

When I try to post data from angular to my nodejs backend it doesn't work. [Backend] This is the function that catches the posted data. I tested it with postman and it worked. The console.log is just ...
0
votes
1answer
47 views

Angular 2 Spring Boot Login CORS Problems

I am trying to develop an application with Spring Boot for the back end and Angular 2 for the front end. Actually i have connection problems, when i accessing on the mvc login page from spring. I ...
11
votes
2answers
4k views

Reject from 'response' into 'responseError'

Sometimes, the API I'm using will return 200 ok even though there has been an error. The response JSON object will look something like: { error: true } I've built a $http response interceptor ...
3
votes
2answers
53 views

Accessing custom http response headers in angularjs

I am trying to access the header 'error-detail' as you can see in the browser network inspector (link above), the header gets returned. Server-wise I have also added the custom header to the 'Access-...
1
vote
1answer
42 views

How to use post method in AngularJS

I am fairly new to the Angular world, and i got some issues on using http post method. Please help me with this, thank you! To make my code look easier, I cut out the irrelevant stuff. Background: I ...
0
votes
2answers
42 views

Property 'update' does not exist on type 'Http'

I used Angular 2 Release and using Http from @angular/http. When I call the method update, generate this error: "Property 'update' does not exist on type 'Http'". On method Get and Post, Work ...
211
votes
11answers
206k views

Processing $http response in service

I recently posted a detailed description of the issue I am facing here at SO. As I couldn't send an actual $http request, I used timeout to simulate asynchronous behavior. Data binding from my model ...
0
votes
1answer
36 views

Angular 2 observable-subscribe showing undefined

I am having the same challenge as was faces in the SO Post here I am getting undefined in the subscribe method in my component.ts, even though in my service i have the data. See codes below p....
5
votes
3answers
195 views

What is the HTTP promise object in AngularJS?

Although I am working with the HTTP promise object in AngularJS, I don't have a clear concept of what an HTTP promise object actually is and what the is difference between an HTTP promise object and a ...
1
vote
2answers
37 views

Angular JS $http promise object — How does it work?

All, I'm a beginner to Angular framework and have been reading $http service. I thought I understood Promise object in Angular JS until the below questions popped up my mind. Can you please help me ...
2
votes
1answer
4k views

Angular 2 Http – How to Get JSON Data from API with finance_charts_json_callback() callback

I'm trying to get json data from this api: http://chartapi.finance.yahoo.com/instrument/1.0/NFLX/chartdata;type=quote;range=1d/json And I don't know how to get into the returned ...
1
vote
2answers
40 views

How to serialize GET params with Nested Objects

I need to send in the following get request via Angular. Upon this request I have a rails server that takes in the param and returns JSON data. GET request needed: http://localhost:8080/clients....
0
votes
1answer
66 views

Angular 2 Webworkers Http Uncaught (in promise): not implemented

I've been stuck on an error that I'm not completely sure how to solve. My application is made in Angular2 and runs completely in a webworker largely based on this tutorial http://www.syntaxsuccess.com/...
1
vote
1answer
34 views

MVC model binding complex type that has a property of complex type collection with Angular JS

I am developing an Web application using Angular JS and ASP.NET MVC. But I am having a problem with model binding complex type. Please let me explain what I am doing first. I am uploading list of ...
0
votes
4answers
35 views

how to send data with ever $http post

I wanted to be able to send ipAddress for every $http.post() that's being sent to backend without manually mentioning it every time i send a post. How to do it in angular ? I found out there was $ajax....
46
votes
4answers
102k views

Angularjs autocomplete from $http

I'm trying to write an autocomplete directive that fetches data from the server using an $http request (without using any external plugins or scripts). Currently it works only with static data. Now, I ...
0
votes
1answer
165 views

Angular $http request timeout not caught in error function on iOS 10 cordova

This is happening on Safari iOS 10 Cordova:6.3.1 Request using Angular $http, error function not called $http.get("http://10.255.255.1").then(function(res){ console.log("res: " + res); },function(...
0
votes
1answer
88 views

Angularjs - cannot pass data from factory to controller

I'm new to angular and find myself stuck. I am trying to pass data from a factory to a controller and it returns undefined no matter what I have tried. Can anyone help? Ultimately I will need to ...
0
votes
2answers
44 views

Angular 2 - http get return wrong object

I'm using @angular/http get to fetch data from server, here is my code : private _currentPT: any; public phongtroDetailChange = new Subject(); layPhongtro(id: number): Promise<any> { return ...
8
votes
1answer
17k views

Angular 2 http request with Access-Control-Allow-Origin set to *

I'm using angular2 and typescript. I'm trying to post to my mail chimp subscription list. My code so far: constructor(router: Router, http: Http){ this.router = router; this.http = ...
7
votes
4answers
436 views

progress bar on web request ($http) AngularJS

I'm new in AngularJS. I'm trying to make a request to a web service. I would like to implement a progress bar that tells me what percentage this request. Maybe someone has a basic example of which can ...
0
votes
2answers
60 views

Post And send object to MVC Web Api using Angular 2

I want to post data to my MMVC web api by using angular 2. But i don't know how to pass a object to my MVC API using angular. Any Help will be grateful. My Service Code in Angular 2 @Injectable() ...
0
votes
1answer
58 views

How to Handle multiple Ajax call calling same function?

Hi have 4 directives on the page, all directive require list of user. User List is stored in database which require hhtp request. As 4 directive are on the page at same time so 4 different ajax call ...
0
votes
2answers
374 views

call function A in function A after success call function B in angular js

I am using some functions that send $http async request to server side.i want to call same current function after relogin user if response is "notlogin". I think i need to use promise but how? $...
1
vote
2answers
25 views

Best separation of concerns approach for $http tasks between a controller and service

(working with Angular 1.5) Read many articles (some recent, some old / outdated) on the subject of $http requests, promises, and separation of concerns, and am currently experimenting with the ...
1
vote
0answers
65 views

Using Elasticsearch Scroll API with AngularJs

My Angular (v1.2.15) application needs to process a large (60k entries) index in Elasticsearch (v2.4). The index is too large to use traditional paging using from and size parameters in the ...
0
votes
1answer
40 views

AngularJS - resolve $http instead injecting value

I have a small tool, using AngularJS with the .value() recipe, which currently dumps almost the entire DB as JSON into this value. So I want to optimise the pages by loading some of this information ...
1
vote
1answer
25 views

Issue in binding service response with html component

I am using a slider component to represent my saved date ranges, I am facing the issue of the slider running before my service returns the HTTP response from backend, therefore I am facing the issue ...
0
votes
3answers
25 views

Using $http inside my own service - variable does not persist

I try to use a service to get some data from server, but I had a problem: even the console log out the length when I print 'myData.length', when I try to find length of '$scope.test' controller ...
179
votes
3answers
106k views

AngularJs ReferenceError: $http is not defined

I have the following Angular function: $scope.updateStatus = function(user) { $http({ url: user.update_path, method: "POST", data: {user_id: user.id, draft: true} ...
1
vote
1answer
69 views

Angular 2 HTTP Headers not being added to request

I have the following http request in which I add the header to the request, however the request fails and when I look in the Network tab of the browser the request headers don't include the ...
0
votes
0answers
30 views

angular basic auth request never finishes on iOS when wrong credentials given, even with interceptor

Authentication works perfectly fine on Android but on ios, if wrong credentials are given, the request never completes and 401 is never returned. In the web inspector, I can see the request still ...
0
votes
1answer
33 views

Angular: load environment properties before config/run

I'm developing a angular app, and this app has about a 10 configurable properties (depending on the environment and client). I had those properties in json config files, but this is really ...
1
vote
1answer
123 views

Using http.put() results in: '400 Bad Request for URL exception'

update(url: string, data: Object): Promise<Application> { return this.http .put(url, JSON.stringify(data), {headers: this.headers}) .toPromise() .then(() => data) ...
1
vote
1answer
1k views

Angular 2 : No provider for ConnectionBackend

Get this "No provider for ConnectionBackend!" error when trying to use http with a promise. main.ts // ... tl;dr import a bunch of stuff platformBrowserDynamic().bootstrapModule(MyModule); ...
0
votes
1answer
75 views

Angular 2 HTTP service problems

I'm working with Angular 2.1.0 and am having problems trying to create an HTTP service to call a REST API provided by my server. I've looked around a lot using Google, and read many articles about how ...
3
votes
3answers
44 views

$http service cache when the method is post

when I set the $http to cache requests, I still see duplicate requests (with the same url and same data) sent to the server from browser network, $http.post(url, data, {cache:true} ).success(function(...