AngularJS Stalled Requests to REST API - angularjs
I have an AngularJS (1.4) app that relies upon $http.get requests to a REST API.
There are two types of request, one for "Search Results", and one for "View Profile". Sometimes (but not consistently so), the request for "View Profile" is not returned. Checking in the Chrome network tab it's marked as Stalled.
Looking this up it seems maybe I am hitting the Chrome max connections limit - but I don't understand how this can be the case as surely the "connection" is not created again each time an $http.get request is called?
Does anybody have any ideas?
Simplified code below:
app.factory('garageService', function($http,$q) {
var garageService = {};
var url = ''; // CAN'T SHARE
var token = ''; // CAN'T SHARE
var radius = 50;
// GET SEARCH RESULTS
garageService.getList = function(lat,lng) {
var deferred = $q.defer();
if(window.XDomainRequest){
//XDR Version for IE
} else {
$http.get(url+'/'+token+'/list/'+lat+'/'+lng+'/'+radius, { cache: true, timeout: 10000 }).success(function(response){
deferred.resolve(response);
}).error(function(){
deferred.reject();
});
}
return deferred.promise;
}
// GET VIEW PROFILE
garageService.getProfile = function(id) {
var deferred = $q.defer();
if(window.XDomainRequest){
//XDR Version for IE
} else {
$http.get(url+'/'+token+'/get/'+id, { cache: true, timeout: 10000 }).success(function(response){
deferred.resolve(response);
}).error(function(){
deferred.reject();
});
}
return deferred.promise;
}
return garageService;
});
And here are the response headers from a working request:
Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin: //CAN'T SHARE
Cache-Control:no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Type:application/json
Date:Thu, 31 Dec 2015 10:28:37 GMT
ETag:"1451557717"
Expires:Sun, 19 Nov 1978 05:00:00 GMT
Keep-Alive:timeout=2, max=200
Last-Modified:Thu, 31 Dec 2015 10:28:37 GMT
Server:Apache
Transfer-Encoding:chunked
X-Powered-By:PHP/5.3.3
Related
Can't get this AngularJs HTTP request to work?
I'm trying to use the $http service in a angularJS app but I'm getting the below error in my console. XMLHttpRequest cannot load http://example.com/data.service/getSomething/hghfg7igb757. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://other-example.dev' is therefore not allowed access. This is my AngularJS Controller: app.controller('mainController', ['$scope', '$http', function($scope, $http){ var url = 'http://example.com/data.service/getSomething/hghfg7igb757'; $http({ method: 'GET', cache: true, url: url, headers: { 'Content-Type': 'application/json; charset=utf-8' } }). success(function(status) { //your code when success $scope.data = data; }). error(function(status) { //your code when fails }); }]); I've read this may have something to do with my server configuration, I'm using gulp-connect https://www.npmjs.com/package/gulp-connect. Or is it to do with the server config of the site I'm requesting from? UPDATE I checked the http headers with curl but it doesn't seem to tell me much? $ curl -I http://example.com/data.service/getSomething/hghfg7igb757 HTTP/1.1 200 OK Date: Wed, 07 Dec 2016 22:35:19 GMT Server: WildFly/8 Expires: Wed, 07 Dec 2016 22:40:19 GMT X-Powered-By: Undertow/1 X-dmg-elapsed-time: 30ms X-dmg-host-address: 17?.??.???.?0 X-dmg-generated-time: Wed, 07 Dec 2016 22:35:19 GMT Content-Type: application/json;charset=UTF-8 Content-Language: en- X-dmg-node-name: dbfr_node_1 Vary: Accept-Encoding X-Varnish-Bereq-Backend: real_backend_llr X-Varnish-Bereq-Retries: 0 Last-Modified: Wed, 07 Dec 2016 22:35:19 GMT Cache-Control: public, max-age=300 X-Varnish: 1376270 Age: 0 Via: 1.1 varnish-v4 X-Varnish-Cache: MISS X-Varnish-Served-By-Host: jul.max.ie X-Varnish-Served-By-IP: 1?.???.??.?? X-Varnish-Pool: http_pages X-Varnish-Req-Backend-Hint: dead X-Varnish-Req-Restarts: 0 X-Varnish-Hash: /data.service/getSomething/hghfg7igb757 X-Varnish-Backend-Ourself: varnish_server_jul_llr X-DMG-Version: 6.20.51.2358 Accept-Ranges: none Connection: keep-alive
How can I enable CORS with gulp-connect? install cors package: npm install --save-dev cors then add it as middleware to connect: var gulp = require('gulp'); var connect = require('gulp-connect'); var cors = require('cors'); gulp.task('connect', function() { connect.server({ root: 'app', middleware: function() { return [cors()]; } }); }); -- https://github.com/AveVlad/gulp-connect/issues/100#issuecomment-74369427 how can I check the headers in the response? $http(...). then(function onSuccess(response) { // Handle success var data = response.data; var status = response.status; var statusText = response.statusText; var headers = response.headers; var config = response.config; ... console.log(headers()); }). catch(function onError(response) { // Handle error var data = response.data; var status = response.status; var statusText = response.statusText; var headers = response.headers; var config = response.config; ... console.log(headers()); }); $http's deprecated custom callback methods - success() and error() - have been removed. You can use the standard then()/catch() promise methods instead, but note that the method signatures and return values are different. -- AngularJS Developer Guide - Migrating from 1.5 to 1.6 - $http
This turned out to be a CORs issue on the server side
Angular $http executes function "success" instead of "error"
my Angular client calls a web api function which checks if the user is authorized by password and user name. Here is the relevant beginning of the method: public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context) { var allowedOrigin = context.OwinContext.Get<string>("as:clientAllowedOrigin"); var userManager = context.OwinContext.Get<DividendsManagerUserManager>(); if (allowedOrigin == null) allowedOrigin = "*"; context.OwinContext.Response.Headers.Add("Access-Control-Allow-Origin", new[] { allowedOrigin }); var user = await userManager.FindAsync(context.UserName, context.Password); if (user == null) { context.SetError("invalid_grant", "Der Benutzername oder das Passwort ist ungültig."); return; } As you see, I use context.SetError in case the provided login is invalid. Doing so returns this message as seen in Fiddler: HTTP/1.1 400 Bad Request Cache-Control: no-cache Pragma: no-cache Content-Type: application/json;charset=UTF-8 Expires: -1 Server: Microsoft-IIS/10.0 Access-Control-Allow-Origin: * X-Powered-By: ASP.NET Date: Fri, 18 Nov 2016 12:49:10 GMT Content-Length: 97 {"error":"invalid_grant","error_description":"Der Benutzername oder das Passwort ist ungültig."} Looks good to me. But in Angular, the api call "succeeds", because the success function callback is executed: var _login = function(loginData) { var data = "grant_type=password&username=" + loginData.userName + "&password=" + loginData.password + "&client_id=" + authSettings.clientId; var deferred = $q.defer(); $http.post(serviceBase + 'token', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }).success(function(response) { localStorageService.set('authorizationData', { token: response.access_token, userName: loginData.userName, refreshToken: response.refresh_token, useRefreshTokens: true }); fillAuthData(); deferred.resolve(response); }).error(function(err, status) { _logOut(); deferred.reject(err); }); return deferred.promise; }; Anyone knows what wents wrong? Regards, Torsten P.S.: Within the success function I could check if the response contains an error. But that feels like a bad hack.
In a promise chain, rejections can be converted to success by returning values to the rejection handler. This makes it possible to fix problems and retry an operation. But it can also lead to bugs related to unwanted conversions. promise.then(function successHandler(value) { //return to chain value return value; }).catch(function rejectHandler(errorValue) { //to avoid conversion //throw to chain rejection throw errorValue; //OR return rejected promise //return $q.reject(errorValue); }); One of the most common causes of unwanted conversions is failing to return or throw anything: //ERRONEOUS function responseError(errorResponse) { console.log(errorResponse.status); } In the above example, the rejection handler erroneously converts the rejection to a success. When a function omits either a return statement or a throw statement, the function returns undefined. This causes the rejection to be converted to a success that resolves with a value of undefined. So when debugging erroneous convertions, check the rejection handlers. Then look for a badly behaving interceptor.
I just found the source of the error. I wrote an interceptor. My intention was just to set a property of a service I injected into the interceptor. Because of this, I just did not manipulate the rejection in any way and just passed it through like this: function responseError(rejection) { busyService.isBusy = true; return rejection; } But this seems to make the $http.post a success. If I do this the $http.post is an error (as wanted): function responseError(rejection) { busyService.isBusy = true; var deferred = $q.defer(); deferred.reject(rejection); return deferred.promise; } I still don't know why and will have to further investigate. If someone can further explain, this would be nice.
S3 putObject fails using aws-sdk
It's driving me crazy, any help would be much appreciated! To set up my bucket in S3 I followed http://www.cheynewallace.com/uploading-to-s3-with-angularjs/ Regarding this post I made following "improvements" by extended the policy with a wildcard and giving more rights { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObject", "s3:GetObjectAcl", "s3:GetObjectTorrent", "s3:GetObjectVersion", "s3:GetObjectVersionAcl", "s3:GetObjectVersionTorrent", "s3:PutObject", "s3:PutObjectAcl", "s3:PutObjectVersionAcl" ], "Resource": [ "arn:aws:s3:::photos-eu/*" ] } ] } and added < ExposeHeader>ETag< /ExposeHeader > to the Cors settings of the bucket Then my angular service using the aws-sdk look like /// <reference path="../../../typings/tsd.d.ts" /> module Services { export interface IS3UploadService { upload(imgName:string, imgData:string):ng.IPromise<{}>; } export class S3UploadService implements IS3UploadService { static $inject = ['$q']; private bucket:AWS.S3; constructor(private $q:ng.IQService) { var credentials = new AWS.Credentials("myAccessKeyId", "mySecretAccessKey"); AWS.config.update(credentials); AWS.config.region = "eu-west-1"; this.bucket = new AWS.S3({params: {Bucket: 'peterparker-photos-eu', maxRetries: 10, region: "eu-west-1"}}); } upload(imgName:string, imgData:string):ng.IPromise<{}> { var deferred = this.$q.defer(); var params:AWS.s3.PutObjectRequest = { Bucket: "peterparker-photos-eu", Key: imgName, Body: imgData, ContentType: "image/jpeg", ContentEncoding: "Base64" }; this.bucket.putObject(params, (err:any, data:any) => { if (err) { console.error("->" + JSON.stringify(err)); deferred.reject(err); } else { console.info(data); deferred.resolve(data); } }); return deferred.promise; } } } angular.module('App') .service('S3UploadService', Services.S3UploadService); For my test purpose, I push in the imgData an img encoded as Base64, something like "/9j/4AAQSkZJRgABAgAAZABkA...." (of course a valid image converted with http://base64-image.de) And as result, each time I try, I've got following error {"line":25,"column":24996,"sourceURL":"http://localhost:8100/lib/aws-sdk/dist/aws-sdk.min.js","message":"The request signature we calculated does not match the signature you provided. Check your key and signing method.","code":"SignatureDoesNotMatch","region":null,"time":"2016-06-08T15:12:09.945Z","requestId":null,"statusCode":403,"retryable":false,"retryDelay":60.59883770067245} So much fun... Update headers: General Request URL:https://peterparker-photos-eu.s3-eu-west-1.amazonaws.com/1465408512724.jpg Request Method:PUT Status Code:403 Forbidden Remote Address:54.231.131.16:443 Response headers Access-Control-Allow-Methods:HEAD, GET, PUT, POST, DELETE Access-Control-Allow-Origin:* Access-Control-Expose-Headers:ETag, x-amz-meta-custom-header Connection:close Content-Type:application/xml Date:Wed, 08 Jun 2016 17:55:20 GMT Server:AmazonS3 Transfer-Encoding:chunked Vary:Origin, Access-Control-Request-Headers, Access-Control-Request- Method x-amz-id-... x-amz-request-id:... Request Headers Accept:*/* Accept-Encoding:gzip, deflate, sdch, br Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,de;q=0.2 Authorization:AWS ... Connection:keep-alive Content-Encoding:Base64 Content-Length:38780 Content-MD5:... Content-Type:image/jpeg; charset=UTF-8 Host:peterparker-photos-eu.s3-eu-west-1.amazonaws.com Origin:http://localhost:8100 Referer:http://localhost:8100/?ionicplatform=ios User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 X-Amz-Date:Wed, 08 Jun 2016 17:55:20 GMT X-Amz-User-Agent:aws-sdk-js/2.3.18 Request payload Img base64 code Update Even by trying to upload a non Base64 content it finish with the same error var paramsHtml:AWS.s3.PutObjectRequest = { Bucket: "peterparker-photos-eu", Key: "HelloWorld.html", Body: "The Body", ContentType: "text/html" }; Update #2 I moved to a solution with a signed URL generated by my node js server as described in following solution, still got the same error as result...but I least I try ;) upload file from angularjs directly to amazon s3 using signed url
Freak I finally find the solution or at least a solution. After migrating my client aws-sdk based solution to a solution where the server generate a signedUrl I was still facing the same error. Short story long, it fixed the problem by setting in both side the Content-type for the header. My code if someone face the same problem one day: Server Node.js var AWS = require('aws-sdk'); AWS.config.update({accessKeyId: "myKey", secretAccessKey: "mySecret"}); AWS.config.region = 'eu-west-1'; app.post('/api/images', securityPolicy.authorise, function (req, res) { var s3 = new AWS.S3(); var imgName = req.body.imgName; var contentType = req.body.contentType; // Expires in seconds var params = {Bucket: 'photos-eu', Key: imgName, Expires: 600, ContentType: contentType}; s3.getSignedUrl('putObject', params, function (err, url) { if (err) { res.status(500).json({ error: "Presigned S3 url for putObject can't be created. " + JSON.stringify(err) }); } else { res.json({url: url}); } }); }); Client angular: First or course there is the part to call the node server, obvious POST to my server And then the second part processing the signedURL private uploadToS3(preSignedUrl:string, imgData:string):ng.IPromise<{}> { var deferred = this.$q.defer(); // Post image to S3 this.$http({ method: 'PUT', url: preSignedUrl, headers: {'Content-Type': 'image/jpeg'}, data: imgData }) .then((response:any) => { console.log("Image uploaded to S3" + JSON.stringify(response)); deferred.resolve(); }, (response:any) => { console.log("Error Presigned URL" + JSON.stringify(response)); deferred.reject(response); }); return deferred.promise; }
How to disable caching of AJAX requests in Angular in IE
I have an angular application that makes HTTP GET calls to the server. It works fine on Chrome & Firefox. However, I figured out that IE caches the GET response, and after I do a POST, I need to call the same GET request and get the new updated response but IE caches it. I want to disable caching just for IE. I tried using a 'If-None-Match': '*' request header on my GET calls, but then that disables caching for everything. Is there a way to do that conditionally for IE only? Or is there another way to disable it?
HTML <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT"> OR JS if (!$httpProvider.defaults.headers.get) { $httpProvider.defaults.headers.common = {}; } $httpProvider.defaults.headers.common["Cache-Control"] = "no-cache"; $httpProvider.defaults.headers.common.Pragma = "no-cache"; $httpProvider.defaults.headers.common["If-Modified-Since"] = "0";
Using the above info I was able to get this working on a one-off request inside a controller instead of changing the global defaults: var configOptions = { headers: { common: { "Cache-Control": "no-cache", "If-Modified-Since": "0", "Pragma": "no-cache" } } }; $http.get("path/to/file.json", configOptions) .then(function (response){ //do stuff });
$http, in IE. Not having response code of 200 or 304. It just uses local cache. Try adding headers to $httpProvider. angular.module(ApplicationConfiguration.applicationModuleName) .config(['$httpProvider', function($httpProvider) { //initialize get if not there if (!$httpProvider.defaults.headers.get) { $httpProvider.defaults.headers.get = {}; } //disable IE ajax request caching $httpProvider.defaults.headers.get['If-Modified-Since'] = 'Mon, 26 Jul 1997 05:00:00 GMT'; $httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache'; $httpProvider.defaults.headers.get['Pragma'] = 'no-cache'; }]);
I know that it's an old thread. Only saying that I just tested it and none of disscussed headers are observed by IE11. As IE takes only care of the url to determine if It is cached or not, I simply added a date in query string, like : $http.get("https://myURLWithoutParameters"?t=" + new Date().getTime()) .then(function (response) { // Handle response }, function (response) { // Error handling });
AngularJs download excel
I'm trying to download an excel file from server in angularjs but I'm getting rare characters when I try to generate a blob. Here is my server response (an array of bytes): [-48,-49,17,-32,-95,-79,26,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,0,3,0,-2,-1,9,0,6,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,7,0,0,0,1,0,0,0,-2,-1,-1,-1,0,0,0,0,8,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,8,16,0,0,6,5,0,-45,16,-52,7,65,0,0,0,6,0,0,0,-31,0,2,0,-80,4,-63,0,2,0,0,0,-30,0,0,0,92,0,112,0,7,0,0,114,111,100,114,105,103,111,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,66,0,2,0,-80,4,97,1,2,0,0,0,61,1,2,0,0,0,-100,0,2,0,14,0,25,0,2,0,0,0,18,0,2,0,0,0,19,0,2,0,0,0,-81,1,2,0,0,0,-68,1,2,0,0,0,61,0,18,0,104,1,14,1,92,58,-66,35,56,0,0,0,0,0,1,0,88,2,64,0,2,0,0,0,-115,0,2,0,0,0,34,0,2,0,0,0,14,0,2,0,1,0,-73,1,2,0,0,0,-38,0,2,0,0,0,49,0,21,0,-56,0,0,0,-1,127,-112,1,0,0,0,0,0,0,5,0,65,114,105,97,108,49,0,21,0,-56,0,0,0,-1,127,-112,1,0,0,0,0,0,0,5,0,65,114,105,97,108,49,0,21,0,-56,0,0,0,-1,127,-112,1,0,0,0,0,0,0,5,0,65,114,105,97,108,49,0,21,0,-56,0,0,0,-1,127,-112,1,0,0,0,0,0,0,5,0,65,114,105,97,108,30,4,26,0,5,0,21,0,0,34,36,34,35,44,35,35,48,95,41,59,40,34,36,34,35,44,35,35,48,41,30,4,31,0,6,0,26,0,0,34,36,34,35,44,35,35,48,95,41,59,91,82,101,100,93,40,34,36,34,35,44,35,35,48,41,30,4,32,0,7,0,27,0,0,34,36,34,35,44,35,35,48,46,48,48,95,41,59,40,34,36,34,35,44,35,35,48,46,48,48,41,30,4,37,0,8,0,32,0,0,34,36,34,35,44,35,35,48,46,48,48,95,41,59,91,82,101,100,93,40,34,36,34,35,44,35,35,48,46,48,48,41,30,4,44,0,42,0,39,0,0,95,40,42,32,35,44,35,35,48,95,41,59,95,40,42,32,40,35,44,35,35,48,41,59,95,40,42,32,34,45,34,95,41,59,95,40,64,95,41,30,4,53,0,41,0,48,0,0,95,40,34,36,34,42,32,35,44,35,35,48,95,41,59,95,40,34,36,34,42,32,40,35,44,35,35,48,41,59,95,40,34,36,34,42,32,34,45,34,95,41,59,95,40,64,95,41,30,4,61,0,44,0,56,0,0,95,40,34,36,34,42,32,35,44,35,35,48,46,48,48,95,41,59,95,40,34,36,34,42,32,40,35,44,35,35,48,46,48,48,41,59,95,40,34,36,34,42,32,34,45,34,63,63,95,41,59,95,40,64,95,41,30,4,52,0,43,0,47,0,0,95,40,42,32,35,44,35,35,48,46,48,48,95,41,59,95,40,42,32,40,35,44,35,35,48,46,48,48,41,59,95,40,42,32,34,45,34,63,63,95,41,59,95,40,64,95,41,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,0,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,1,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,1,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,2,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,2,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,-11,-1,32,0,0,-12,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,0,0,0,0,1,0,32,0,0,0,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,1,0,43,0,-11,-1,32,0,0,-8,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,1,0,41,0,-11,-1,32,0,0,-8,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,1,0,44,0,-11,-1,32,0,0,-8,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,1,0,42,0,-11,-1,32,0,0,-8,0,0,0,0,0,0,0,0,-64,32,-32,0,20,0,1,0,9,0,-11,-1,32,0,0,-8,0,0,0,0,0,0,0,0,-64,32,-109,2,4,0,16,-128,3,-1,-109,2,4,0,17,-128,6,-1,-109,2,4,0,18,-128,4,-1,-109,2,4,0,19,-128,7,-1,-109,2,4,0,0,-128,0,-1,-109,2,4,0,20,-128,5,-1,96,1,2,0,0,0,-123,0,39,0,30,7,0,0,0,0,31,0,99,117,101,115,116,105,111,110,97,114,105,111,95,53,53,52,57,56,99,97,99,48,48,97,51,100,101,98,48,100,102,-116,0,4,0,1,0,1,0,-82,1,4,0,1,0,1,4,23,0,8,0,1,0,0,0,0,0,0,0,-4,0,-105,1,34,0,0,0,34,0,0,0,15,0,0,78,111,109,98,114,101,32,112,97,99,105,101,110,116,101,26,0,0,84,46,32,105,100,101,110,116,105,102,105,99,97,99,105,-13,110,32,112,97,99,105,101,110,116,101,6,0,0,73,80,83,83,45,52,6,0,0,73,80,83,83,45,49,12,0,0,67,117,101,115,116,105,111,110,97,114,105,111,6,0,0,73,80,83,83,45,51,6,0,0,73,80,83,83,45,50,23,0,0,73,100,101,110,116,105,102,105,99,97,99,105,-13,110,32,112,97,99,105,101,110,116,101,6,0,0,73,80,83,83,45,56,2,0,0,73,68,6,0,0,78,-6,109,101,114,111,28,0,0,73,80,83,83,95,85,82,73,78,65,82,89,95,81,85,65,76,73,84,89,95,79,70,95,76,73,70,69,10,0,0,73,80,83,83,95,83,67,79,82,69,17,0,0,70,101,99,104,97,32,100,101,32,115,111,108,117,99,105,-13,110,6,0,0,73,80,83,83,45,54,6,0,0,73,80,83,83,45,55,6,0,0,73,80,83,83,45,53,1,0,0,53,24,0,0,53,53,52,57,56,99,97,99,48,48,97,51,100,101,98,48,100,102,100,98,50,100,98,57,1,0,0,54,2,0,0,49,48,1,0,0,48,4,0,0,73,80,83,83,12,0,0,79,99,99,97,115,105,111,110,97,108,108,121,5,0,0,49,50,49,50,50,1,0,0,49,12,0,0,49,32,116,111,32,54,32,116,105,109,101,115,1,0,0,50,11,0,0,51,32,77,97,121,44,32,50,48,49,53,1,0,0,56,16,0,0,77,111,115,116,32,111,102,32,116,104,101,32,116,105,109,101,3,0,0,79,110,101,14,0,0,114,111,100,114,105,103,111,32,99,97,114,100,105,111,1,0,0,55,-1,0,42,0,8,0,93,5,0,0,12,0,0,0,-39,5,0,0,-120,0,0,0,66,6,0,0,-15,0,0,0,-115,6,0,0,60,1,0,0,-41,6,0,0,-122,1,0,0,10,0,0,0,9,8,16,0,0,6,16,0,-69,13,-52,7,-63,0,0,0,6,0,0,0,11,2,20,0,0,0,0,0,1,0,0,0,3,0,0,0,0,0,0,0,-10,9,0,0,13,0,2,0,1,0,12,0,2,0,100,0,15,0,2,0,1,0,17,0,2,0,0,0,16,0,8,0,-4,-87,-15,-46,77,98,80,63,95,0,2,0,1,0,42,0,2,0,0,0,43,0,2,0,0,0,-126,0,2,0,1,0,-128,0,8,0,0,0,0,0,0,0,0,0,37,2,4,0,0,0,-1,0,-127,0,2,0,-63,4,20,0,0,0,21,0,0,0,-125,0,2,0,0,0,-124,0,2,0,0,0,-95,0,34,0,1,0,100,0,1,0,1,0,1,0,2,0,44,1,44,1,0,0,0,0,0,0,-32,63,0,0,0,0,0,0,-32,63,1,0,85,0,2,0,8,0,0,2,14,0,0,0,0,0,3,0,0,0,0,0,17,0,0,0,8,2,16,0,1,0,0,0,17,0,-1,0,0,0,0,0,64,1,15,0,8,2,16,0,2,0,0,0,17,0,-1,0,0,0,0,0,64,1,15,0,-3,0,10,0,1,0,0,0,15,0,10,0,0,0,-3,0,10,0,1,0,1,0,15,0,9,0,0,0,-3,0,10,0,1,0,2,0,15,0,4,0,0,0,-3,0,10,0,1,0,3,0,15,0,13,0,0,0,-3,0,10,0,1,0,4,0,15,0,1,0,0,0,-3,0,10,0,1,0,5,0,15,0,7,0,0,0,-3,0,10,0,1,0,6,0,15,0,0,0,0,0,-3,0,10,0,1,0,7,0,15,0,3,0,0,0,-3,0,10,0,1,0,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,-1,-1,-1,-1,-1,-1,-1,-1] and its headers: Access-Control-Allow-Headers → Content-Type, jwt Access-Control-Allow-Methods → POST, GET, PUT, DELETE Access-Control-Allow-Origin → * Content-Disposition → attachment; filename=questionnaire_55498cac00a3deb0dfdb2db9.xls Content-Length → 13723 Content-Type → application/vnd.ms-excel; charset=UTF-8 Date → Thu, 07 May 2015 08:40:48 GMT Last-Modified → Thu, 07 May 2015 08:40:48 GMT Server → spray-can/1.3.2 In my angularjs application i have something like: // HttpService downloadRequest: function (url, handledStatuses) { var hs = handledStatuses || []; var deferred = $q.defer(); $http.get(url, {responseType: 'arraybuffer', handledStatuses: hs}) .success(function (data, status, headers, config) { deferred.resolve(data); }) .error(function (error, status, headers, config) { deferred.reject(error); }); return deferred.promise; } // Download Service getQuestionnaireReport: function (questionnaireId) { return HttpManager.downloadRequest(UrlManager.getReportsUrl() + 'questionnaires/' + questionnaireId); } // Download manager downloadFile: function (bytes, name, extension, type) { if (this.detectIE() === false) { var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL; var link = document.createElement("a"); if ("download" in link) { var blob = new Blob([bytes], {type: type}); var url = urlCreator.createObjectURL(blob); link.setAttribute("href", url); link.setAttribute("download", name + '.' + extension); var event = document.createEvent('MouseEvents'); event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); link.dispatchEvent(event); } } else { window.navigator.msSaveOrOpenBlob(new Blob([bytes], {type: type}), name + '.' + extension); } }, // In my controller $scope.downloadQuestionnaireReport = function (questionnaireId) { $scope.downloadPr = DoctorServices.getQuestionnaireReport(questionnaireId); $scope.downloadPr.then( function (response) { DownloadsManager.downloadFile(response, 'questionnaire_' + questionnaireId, 'xls', 'application/octet-stream'); } ); return $scope.downloadPr; }; I have already tried with different kind of content types and responseTypes, my problem is that I'm getting bizarre characters when I try to open the downloaded file like so: Am I missing something? Thank you all very much in advance.
after some hours looking for a solution to this problem, I realized that my problem was in the response marshaller I was using. At the moment I'm using spray.io as my rest services provider and for my json responses I'm using Json4s library. In this question, my server response is not correct, so the solution I found was to remove Json4s marshaller for this specific service; then all worked as expected.