Answer the question
In order to leave comments, you need to log in
Why is axios get request not working?
Hello everyone, I've been working on a problem for two days now.
The bottom line is, I send a request from the Restlet Client to the server and get a 200 response, everything works fine. But I'm trying to send an axios request through REACT, writes
Access to XMLHttpRequest at .....
Uncaught (in promise) Error: Network Error
at createError (createError.js:17)
at XMLHttpRequest.handleError (xhr.js:80)
validation_token() {
var urlValidation = 'localhost:8000/api/GetTokenData';
var token = this.getToken();
var headers = {
'Token': token
};
axios.get(urlValidation, { headers })
.then(Response => Response.json())
.then(json => {console.log(json)});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question