$http service is a core Angular service
1
vote
3answers
75 views
How do I get the actual error from an Angular $http request?
I'm fairly new to Angularjs. I'm trying to get information on the actual error that occurred during a GET request. I've got the request set up like this:
...
2
votes
2answers
68 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) {
...
0
votes
2answers
42 views
angularjs: $http basic authentication
I tried angular.js and started with a web-ui for a restful api (using http basic auth). It is really nice and all except the authorization works.
Up to now I am using ...
0
votes
2answers
22 views
Angularjs jsonp getting data back
The console.log within the success call will return the data I want but when I put it into someValue it becomes undefined outside of the success function
The only way I've been able to successfully ...
0
votes
2answers
1k views
ionic restful authentication to POST and get data from php
im working on an ionic project to create android and ios app.
im new in ionic and need help to understand how to make a login trough restful services hosted on my server.
the restful uses this auth ...
0
votes
2answers
75 views
Parsing response from $http.jsonp
I am facing trouble in parsing the response I got from calling a URL as :
$scope.getSuggestions = function (val) {
return $http.jsonp('https://Suggestions-api.net/v1/suggest?query=' + ...
0
votes
2answers
58 views
Why not available $scope.value of the variable in runtime?
Why not available $scope.reserved of the variable in runtime? In template {{reserved}} is ок, but in controller value = undefibed.
I have the following code
Service:
'use sctict'
...
0
votes
2answers
100 views
angularjs $http.put changes my URL
I was trying to make a $http.put request with angularjs.
What I do is just:
$http.put("http://mi-url/personalized_product_custom_pages/2")
What it really does is a request to:
...
0
votes
2answers
253 views
AngularJS $http loading screen compatibility
I've used the following angular module to create a loading screen until all $http requests finish. It works fine on angular 1.0.7, but doesn't work on angular 1.2.10 . I need to use angular-resource, ...
2
votes
1answer
412 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 ...
1
vote
1answer
73 views
how to pass headers in http call in angularjs
I am developing mobile application in cordova/phonegap. I am using angularJS for front-end. I am calling services which required 'API-KEY' attribute as header in post request.
I show some ...
1
vote
1answer
584 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
29 views
Angular's $http.post doesn't work, nor does its' $http… but jQuerys ajax does. Why?
For some reason this:
return jquery.ajax('my url', {
crossDomain : true
, data : JSON.stringify({"brand": self.current})
, type : 'POST'
}).success(function(data){
scope.results = data;
...
0
votes
1answer
43 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
56 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
33 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
159 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
46 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
126 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
48 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
64 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
55 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
3k 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:
...
0
votes
1answer
55 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
60 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 ...
2
votes
0answers
604 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
29 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
114 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
22 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">
...
0
votes
0answers
19 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
38 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
30 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
52 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
22 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
105 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 ...
0
votes
0answers
180 views
Following a redirect from Laravel in AngularJS $http
I want to authenticate users by making a POST request in AngularJS (1st code snippet below) to the 'auth' route in Laravel (2nd code snippet below). The 'auth' route then runs the authenticate() ...
0
votes
0answers
153 views
AngularJS dynamic load data from server to directive
I load the base table without guides. I give the directive resulting table. Loads the description of this table from a local JSON file. Build a table through NG-repeat. When I meet a field whose value ...
0
votes
0answers
111 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
278 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
50 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
249 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
658 views
Sending HTTP Post with multiple data through AngularJS
I am using AngularJS. I would like to send multiple data in a HTTP post through AngularJS. The backend runs Cakephp and I have verified that the Rest API works through python HTTP-post.
I have this ...
0
votes
0answers
240 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 ...