-
-
Couldn't load subscription status.
- Fork 11.4k
Closed
Description
Describe the issue
I keep trying to send a GET request to an api, but it keeps on returning the following error
Error: connect ECONNREFUSED 127.0.0.1:80
Example Code
Code snippet to illustrate your question
client.getIdFromUsername = async function(username) {
const axios = require('axios').default;
let id;
try {
let res = await axios({
url: `PRIVATE_API/users/get-by-username?username=${username}`,
method: "GET"
});
id = res.data.Id;
} catch(err) {
return err;
}
return id;
}Expected behavior, if applicable
It sends the request successfully and returns the user ID of the username
Environment
- Axios Version [0.21.1]
- Node.js Version [15.7.0]
- OS: [Windows 10]
Additional context/Screenshots
NONE
Metadata
Metadata
Assignees
Labels
No labels