Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

177
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda