0

I am trying to make an http.get call in angularjs application and i am getting this caution says "Provisional headers are shown" randomnly and especially after long time the application is up and running. In debugger console the status is 'Pending'

this is my angularjs Service code:-

 angular.module("projectionsModule")
.factory("prjProjectionsService", function ($q, $http) {
    return {
        prjProjectionFunction: prjProjectionFunction
    } function prjProjectionFunction() {
        var defer = $q.defer();

        $http.get('/getAllPrjProjections', {
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        }).then(function (success) {
            defer.resolve(success);
        }, function (error) {
            defer.reject(error);
        });

        return defer.promise;
    }
});

This type of piece of code I am using number of times in different controllers. but randomly same issue is coming in different controllers as well. i am unable to figure out why this is happening?

I have seen relative posts but could not help me. (enter link description here)

Could someone please advise me?

Community
  • 1
  • 1
user1516322
  • 35
  • 2
  • 9
  • Hope this helps: [Caution: Provisional headers are shown solution:](http://stackoverflow.com/questions/21177387/caution-provisional-headers-are-shown-in-chrome-debugger) – Cruzer Nov 21 '16 at 11:24
  • I have seen that too but it does not. I don't know why the get request hangs with Pending status randomly and it is not a heavy request at all – user1516322 Nov 21 '16 at 11:31
  • Can anyone please help me? I really do not know what to do. – user1516322 Nov 22 '16 at 11:20
  • 2
    Did you ever figure this out? I am having the same issue. – DavidA Dec 01 '16 at 00:57
  • Unfortunately no, but I think that it has to do with connection to Postgres because when moving to MongoDB with exactly the same code it works without any problem. And I could not find anything in the Internet because this error can be caused by a lot of reasons. – user1516322 Dec 03 '16 at 12:56

0 Answers0