Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda