Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
Fetch but only get status?

When a new domain is attached, I made a logic to check whether the domain works normally through fetch.

fetch("https://" + domain).then((result)=>{
const isOk = result.status === 200
...
 })

However, I thought it would be inefficient to fetch the entire HTML doc through fetch just to check if it works. How can I get only the status value?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can request only the headers, as opposed to the whole page, using the HEAD method. The server should return the same headers as it would if the GET method was used, but no body. You can request this behaviour using the method option:

fetch(url, { method: 'HEAD' })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!