I have a problem with redirect when getting a 303 response with Location URL from a backend API endpoint. The URL can point to any subpage on my page.
When the browser tries to redirect, I get an error:
error: SyntaxError: Unexpected token '<', ") at XMLHttpRequest.onLoad message: "Http failure during parsing for "
It seems that it treats the HTML response as JSON and tries to parse it, but why?
Thanks for your help.
I don't know what to do in this case.
Angular by default try to parse every response as
JSON. You need to specify that is not. For example: