0 | I do HTTP request using $http from my Angular Yeoman app to JSON API service based on Ruby on Rails and set. I have a controller
And I got in browser console:
What am I doing wrong? How can I read headers in my Angular app properly? P.S> Previously it was working and read headers this way successful when Angular was a part of Rails project. Now I use rack-cors on the API serverside. Added to config/application.rb: config.middleware.use Rack::Cors do to allow requests from external apps. |
0
I do HTTP request using $http from my Angular Yeoman app to JSON API service based on Ruby on Rails and set.
I have a controller
angular.module('myApp') .controller('ApiwrapperCtrl', [ '$scope', '$http', '$log', '$rootScope', 'PubNub', '$cookies','$cookieStore', '$window', function($scope, $http, $log, $rootScope, PubNub, $cookies, $cookieStore, $window) { .... And method sending request to API: $scope.useHttp = function() {
var requestURL = "http://localhost:3000/api/v1/auth/sign_in?email=gladys@ha.mil&password=123123123"; var requestType = "POST"