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.
2
votes
2answers
922 views
Building OData $filter URLs with an Angular provider
I have an angular provider for querying an OData service.
Now I'm trying to build a $filter function onto that provider, so I can use it throughout my app.
The problem I'm running into, and so far ...
2
votes
2answers
87 views
angular JS difference between these two ways of calling a web service method
Doesn't matter whether I am posting or deleting etc.. I would write this:
$http({
method: ''
url: '',
data: '',
headers: ''
}).success(function(data, status, headers, config) {
...
1
vote
2answers
39 views
Getting CORS error in AngularJS
I am trying to hit an https based API, which is successfully working in POSTMAN and other REST client, but not in my AngularJS app.
Following is the code -
var req = {
method: 'POST',
url: ...
0
votes
2answers
115 views
Slim Post method not working with AngularJs Http Request
This is my AngularJS controller :
app.controller('emailConfirmCtrl', function ($scope, $http) {
$scope.check_credentials = function () {
var request = $http({
method: 'POST',
url: ...
2
votes
1answer
59 views
Gracefully Handling 401 Not Authorized with Angularjs $http
I am currently working on an problem with a login page for an AngularJS app. The login page uses the $http service to submit the username and password using Basic authentication (Authorization: Basic ...
1
vote
1answer
82 views
$http.get request with multiple $http.get requests inside it not running properly
I have tried different ways to do this but they all have failed. The issue is I have an http.get request that queries data for a given day (total for the entire day), once returned I run multiple ...
1
vote
1answer
130 views
AngularJS: POST request payload empty for ArrayBuffer
I tried to use POST to send some bytes using ArrayBuffer, but it seems that the request payload is always empty. Here's some code snippet:
var buffer = new ArrayBuffer(10);
var dataView = new ...
1
vote
1answer
5k views
$http error handling in angular
$http in my angular project not able to recognize 40X(401,403,405...) errors on iOS.
I am using 1.2.10 angular version and Cordova version 3.4.0.
Below is the code I am using:
...
1
vote
1answer
723 views
ng-grid won't load header row template when using $http interceptors to modify request url
Our application uses an $http interceptor to add tokens to $http requests as a form of security, the token that the interceptor adds are updated every 5 or so minutes. We now want to use ng-grid.
...
0
votes
1answer
36 views
Http.post return (error 400)
I try to post object from back_end bad always i have error 400 i don't know if the problem is in front on in back-end:
the index.html:
<div ng-controller="signupCtrl"> ...
0
votes
1answer
227 views
angularjs $http.post to MVC Controller with [ValidateAntiForgeryToken]
The $http.post method from angular to MVC controller with [ValidateAntiForgeryToken] throws a 500 internal server error with the below message. [We are calling the controller passing the ...
0
votes
1answer
197 views
AngularJs AJAX error
In a typical AJAX call,what is the way to make the error handling more meaningful.
A template code as below does not help in conveying anything.
How do we decipher the exception better?
...
0
votes
1answer
74 views
$http post gets canceled
I have a login form and I'am trying to send a post request to server but it gets canceled.
Here is controller:
angular.module('app.signin', [])
.controller('SigninController', ['$http', ...
0
votes
1answer
28 views
Is $http.jsonp is blocking call.?
As mentioned in the title I am using $http.jsonp in my application for client to server communication, when my application bootstraps it sends the request to server using $http.jsonp I am able to see ...
0
votes
1answer
49 views
AngularJS $http testing
Is it possible to make use of $http without mocking? The service from which the call is made:
// Make the request we are interested in testing
ViewingRepositoryService.getThumbnail(obj, ...
0
votes
1answer
415 views
Add a custom header in http get request angularjs.
This is my angularjs request.
var req = {
method: 'GET',
url: 'http://localhost:8080/test',
headers: {
"x-auth-token" : user.token
...
0
votes
1answer
107 views
AnguarJS - Nested Array Empty when Accessed
I'm going nuts!
My server responds with some JSON at an endpoint. It's something like this:
[{
key: 'value'
nested: [{
key: 'value'
]}
}]
If I access that endpoint directly in my ...
0
votes
1answer
660 views
$http - null plain text response
I have an $http POST call in AngularJS that won't show the server response if the request was bad.
myFactory.create = function(formData) {
deferred = $q.defer()
$http({method: 'POST', url: url, ...
0
votes
1answer
76 views
$http.get() loops with ngrepeat
I have 2 entities as below
person {
personID,
personName,
Array of Cars (Person Car)
}
Cars {
carID,
carName
}
And then the relational entity for Person-Car as below
PersonCar {
...
0
votes
1answer
270 views
How to hide or show menu items when $http result returned with AngularJS
I have a menu and a login page :).
I want to change the menu item but currently I can't refresh menu after login.
If login succeeds, some menu items should display or special user menu items should be ...
0
votes
1answer
72 views
Change an existing $http request interceptor
In my angular app, I have a $http request interceptor called 'authInterceptor' that I create like this:
.factory('authInterceptor', function ($q, $window, EXT_API_BASE, $injector) {
return {
...
0
votes
1answer
180 views
$http response returns the entire index.html
I have site.com.
Each request is redirected here (so 'site.com/book', 'site.com/settings' ecc.. point to 'site.com')
Then I have site.com/api/ where 'site.com/api/user', 'site.com/api/library/' ...
0
votes
1answer
80 views
How to securely set authorization header using angularJs?
It is common to authenticate to web services using an authorization header which contains a secret token. And since the security of this mechanism depends on the token to be secret care should be ...
0
votes
1answer
63 views
AngularJS: issues creating an API request
I have a scenario in which I have to deal with a misconfigured server, which only understands a stringified JSON. What works with the server is:
var req = JSON.stringify({id: 0, method: ...
0
votes
1answer
76 views
Angular - How to Project $http Response
I want to project the result of my $http call into another model in order to make the projection global to the service call.
In other words, the result i get from my http/api call is not using the ...
-1
votes
1answer
37 views
How to load returned html after $http.post
Sorry if this has been asked already, but I can't find an answer!
I'm posting what could almost be form data using angular, and expecting the backend to return an html page. How do I load that page?
...
2
votes
0answers
161 views
Promise Resolution after $http success is getting mixed up
I have created a factory, to handle all my http related calls. It returns following inline code:
return {
get: function (opts) {
var deferred = $q.defer();
var def ...
2
votes
0answers
850 views
AngularJS 1.2 $http seems to cache POST requests when no data is passed
I'm having an issue with AngularJS 1.2 POST requests using $http service.
On a button click, I trigger a POST request like so:
$http.post('my/url').success(function(responseText) {
// Do ...
1
vote
0answers
57 views
Angular $http get failing on json data with forward slash
My Angular get request fails when the JSON data I retrieve contains forward slashes in the data. I'm not sure how to handle such data as specially as I am using $http.get.
Here is the related code:
...
1
vote
0answers
45 views
success&error vs. then&catch in AngularJS $http
In answer to this this question was said
you do not want to ever use success and error (prefer .then and .catch instead
and
$http returns a $q promise with the addition of the success and ...
1
vote
0answers
92 views
Post Request going to Pending state
I am using AngularJS and calling a REST using http. Below is my AJAX code, but all of my request are going to pending status in browser. I have searched this issue on internet and tried a lot of ...
1
vote
0answers
145 views
Angularjs HTTP Returns Error with Status 0
I'm new to angularjs, whenever i request get data from server i will get error status 0. Can someone point out, what wrong with my code.
HTTPGET
Huge Data in terms of 1000+ entries
WCF RESTFull ...
1
vote
0answers
188 views
AngularJS ngResource and IE9 issue: response.data is undefined in the error callback function
ISSUE: In IE9, when I call $resource.save, I get undefined on response.data inside the error callback function. In chrome, response.data has the "errors" JSON object returned from the server.
Here ...
1
vote
0answers
37 views
Concatenation in $http.jsonp filltext string
Hello i'm trying to do dynamic $http request to filltext.com server.
code:
<!DOCTYPE html>
<html lang="en" ng-app="App">
<head>
<meta carset="utf-8">
...
1
vote
0answers
188 views
Manipulate DOM after Angular has retrieved content via $http and added it to a partial view template
I looked at various similar questions such as this one, this one, this one, this one, and this one that failed to provide a solution to my problem before hitting on a solution myself. However, it ...
0
votes
0answers
22 views
Use Pace.ignore() function with AngularJs
I managed to use pace.js in my angular application.
Now I want to hide the loading bar for specific $http calls. I wrap the call with Pace.ignore() but the loading bar still show up...
Code :
...
0
votes
0answers
16 views
Are http response headers being cached by the browser?
I am working on a project where I've had an issue with authentication tokens in response headers, they seem to be cached by the browser.
We use openid, so set a http header called x-token, which is ...
0
votes
0answers
19 views
httpInterceptor rejection loses statusText
I have aproblem where is loose the statusText between the promise calls/rejection. How can i retain and pass on all the infromation from http interceptors event down to the service in which initiated ...
0
votes
0answers
23 views
Timing out Angular http.get trouble with $timeout
I am trying to timeout a $http.get that takes too long, but also doesn't error out. Here is what I have so far. $timeout doesn't seem to cancel the $http.get. Any help is appreciated.
My $http.get ...
0
votes
0answers
25 views
Chaining AngularJS Promises
I am trying to chain AngularJS promises like follows. I have one HTTP request, after this http request is done I need to call another http request but it is dependent on the length of an object (we ...
0
votes
0answers
7 views
$http no caching not working
Ok, this is driving me nuts. $http is caching responses no matter what I do. Or am I doing it wrong? The only hack I have come up with is to pass a false key "cache_key:unique". But this is not a ...
0
votes
0answers
95 views
How to pass Headers value from angularjs to asp.net application
I am using angularJS to call .NET web api. But I am not able to pass headers or may be I am not able to get values from headers in .NET application or may be I have problem with both things.
Scenario ...
0
votes
0answers
88 views
AngularJS ajax post function parameters
I have a legacy Angular controller code here.
In the code below, the jQuery $.ajax method calls the URL, and submits the params object, and submits params as "Form Data".
But I am not sure where are ...
0
votes
0answers
88 views
Modify or access angular interceptors after config phase
Is it possible to access / modify $http interceptors after the config phase? I'm debugging an app that only breaks in production due to being deployed on a different server, so unfortunately I can't ...
0
votes
0answers
123 views
angularjs $http with cache and interceptor
I'm trying to use angulars $http, with both a cache and an interceptor.
The quick question:
Currently when angular gets the answer from the server, it first caches it, and then it passes it through ...
0
votes
0answers
28 views
Angular $http Authorization
I have a problem with $http in Angular. I'm trying to set a headers Authorization to my GET request, but instead of header Authorization the property Access-Control-Request-Headers is set with value ...
0
votes
0answers
358 views
angularjs sending cross origin POST to a Ruby on Rails create method
None of the other questions about this seemed to give a descriptive question and/or receive a thorough answer.
Scenario
Use angular to send cross-origin JSON post data to rails create method.
Code
...
0
votes
0answers
74 views
How to cancel an intercepted $http request in angular based on its httpConfig info?
I am using angular-http-auth package that is an HTTP interceptor for angular that detects 401 Non-Authorized requests and allows to delay request and perform authorization before it.
However, I have ...
0
votes
0answers
419 views
AngularJS How do I make sequential $http calls to access more data?
For the AngularJS $http service,
How do I loop $http calls in order to access sequential data, while each call needs the previous return data to be used in the next call?
I want to make sequential ...
0
votes
0answers
321 views
Angular resource dynamic uri
Once I was using $http in calling all my apis' endpoint. But lately I read that using $resource is much more robust or best practice. Now I'm migrating all my $http call to $resource and I got bump on ...