Angular $http service - force not parsing response to JSON Angular $http service - force not parsing response to JSON json json

Angular $http service - force not parsing response to JSON


You can override the defaults by this:

$http({  url: '...',  method: 'GET',  transformResponse: [function (data) {      // Do whatever you want!      return data;  }]});

The function above replaces the default function you have postet for this HTTP request.

Or read this where they wrote "Overriding the Default Transformations Per Request".


You can also force angular to treat the response as plain text and not JSON:

$http({    url: '...',    method: 'GET',    responseType: 'text'});

This will make sure that Angular doesn't try to auto detect the content type.