When utilizing the $http.get()
method for a GET request, the response is in JSON format, but some characters are HTML encoded. For example, the double quote " is encoded as "
.
{
"description":"invalid",
"errorCode":"error.loginInvalid"
}
I have also implemented
$httpProvider.interceptors.push('httpErrorsInterceptor');
, where httpErrorsInterceptor displays error information in responseError
. However, due to improper decoding of the JSON response, it results in a SyntaxError: Unexpected token & in JSON
being shown in the console. Is there a way to decode the response JSON correctly during processing within $httpProvider
?