This is the recommended way to use transformResponse. that way, you can use all the default transformResponse function already defined
function _transformResponse(){...}
var req= {
url: url,
method:"POST",
transformResponse: $http.defaults.transformResponse.concat([_transformResponse])
}