0
I’m having trouble making a GET request, giving error 415 (Unsupported Media Type).
Although already set the headers he seems not to respect.
Does anyone have any suggestions of what to do to solve the problem? Remembering I’m new to Angularjs
$http.get('https://minhaurl.com.br/api/v1/tasks',
{
headers: {
'Accept': 'application/json; charset=utf-8',
'Content-Type' : 'application/json; charset=utf-8'
}
}
);
I see that it would be interesting to also put the code you have on the server that is called by this request.
– Giancarlo Abel Giulian
@Giancarloabelgiulian the application of the back-end server is private, not even I have access there it, when I make a request via ajax (jQuery) goes smoothly. I managed to solve the problem temporarily in a totally wrong way, I went in the file Angularjs line: 11.949 where it declares the
headers
and added axhr.setRequestHeader('Content-Type', 'Content-Type: application/json; charset=utf-8');
– Wilson Tamarozzi