angularjs-http Questions

2

Solved

Im trying to add a header with my access token to each API call. It works well for all the GET requests, but as soon as I try to make a POST the header isn't added. Here is how I add the token: ...
Quinquennium asked 23/4, 2014 at 12:49

5

Solved

I'm pretty new to the whole AngularJS world and how it works, however I am struggling to get it working as expected. I know that its something to do with the way I am using $http.get() and trying t...
Stereotaxis asked 14/5, 2015 at 15:54

2

Solved

I am trying to create a service to get json and pass it to me homeCtrl I can get the data but when a pass it to my homeCtrl it always returns undefined. Im stuck. My Service: var myService = ang...

3

Solved

See the accepted answer to here for a pretty good explanation on the transFormRequest function/array. In the answer's last example: var transform = function(data){ return $.param(data); } $http...
Lardner asked 14/2, 2014 at 19:51

2

I am using the Angular.js $httpBackend to test some services that wrap $http calls (this is in ngMock, not ngMockE2E). It seems that things like expect and when are sensitive to the order of URL q...
Paraphrastic asked 12/3, 2014 at 20:28

2

Solved

I recently did a lot of coding in AngularJS. After some time it started to feel comfortable with it and also got really productive. But unfortunately there is this one thing I don't understand: Wi...
Yoga asked 9/7, 2015 at 14:25

1

Solved

I have difficulties understanding this error... I dont quite understand why its not a function.... angular.module('mkApp').factory('mkService', function ($http, $log) { function getLookUp(success...

2

Solved

We have few methods in Angular Controller, which are not on the scope variable. Does anyone know, how we can execute or call those methods inside Jasmine tests? Here is the main code. var testC...

2

Solved

In our internal angularjs project, one of the services has $http.head() call which I'm trying to test. For testing, I'm using Fake HTTP backend provided by angular-mocks. Here is the relevant code...
Advantage asked 19/9, 2014 at 17:49

1

Solved

with this code I am trying to send a $http.get request to my rest service: $http({ method: 'GET', url: '/api/item/all', params: { query: { userid: 7 }, fields: 'title' } }); I expected t...
Vesuvian asked 11/7, 2014 at 23:38

3

Solved

I'm calling a back-end server that I cannot control. Currently it's using jQuery ajax like this: return $.ajax({ type: "POST", url: "/api/cases/store", contentType: "application/json", data: J...

1

Is it possible to set a header only for specified domains? The "normal" way of doing this adds that header for all calls, even calls that retrieve HTML templates for example. $http.defaults.head...
Fax asked 18/3, 2014 at 20:57

1

Solved

How do I test my API backend using AngularJS/karma/jasmine tests? I have tried to create the smallest test-case showing my error: echo_server.py from bottle import response, route, run @route('...

© 2022 - 2024 — McMap. All rights reserved.