I'm using axios to get the http status for URLs:
async function getUrlHttpStatus (url) {
try {
const res = await axios({ method: 'get', url })
return {
status: res.status,
statusText: res.statusText
}
} catch (err) {
return {
status: err.response.status,
statusText: err.response.statusText
}
}
}
This obviously brings back all the content from that URL as well, and if there is a lot, it can be very slow.
Is there a way to make a HTTP request, to get the HTTP status code, without downloading all the content from the URL, so it's quick..?