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

174
Views
Send a POST request and receive a response using custom useFetch hook (React.js)

I have used this website to get the logic for a useFetch hook. All I am trying to do is to send a post request and then map the request into a type. I know this will be a simple answer but can't seem to find anything online! Please view the link above for the useFetch hook! :)

EDIT: The body is empty as this is just an example

Error: View screenshot of error

Component:

const requestOptions = {
  method: 'POST',
  headers: {},
  body: JSON.stringify({}),
};
const { data, error } = useFetch<ExampleType>({url, requestOptions});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

UseFetch Documentation says you need to pass in a string as the first argument so call the hook with

useFetch<ExampleType>(url, requestOptions);
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!