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

396
Visualizações
Access query parameters using axios

I am using React in the frontend and Django in the backend and I am currently doing the API integration for which I am using Axios.

So in the frontend side I am calling a URL like this

http://localhost:3000/attempt/?quiz_id=6

and I want the quiz_id = 6 so that I can use this afterward to access data in the backend.

I am using Functional components if that helps.

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

You can take a look at axios's documentation in github

If what you want to do is a GET request this should be enough:

axios.get('http://localhost:3000/attempt/?quiz_id=6')
  .then((res) => {
    // handle success
    console.log(res);
  })

Also you have available this kind of usage:

axios.get('http://localhost:3000/attempt', {
  params: {
    quiz_id: 6
  }
}).then((res) => {
   // handle success
   console.log(res);
  });
about 4 years ago · Juan Pablo Isaza Relatório

0

You can use this too:

const data =  await axios.get('http://localhost:3000/attempt/?quiz_id=6').then(res => res.data);
about 4 years ago · Juan Pablo Isaza Relatório

0

You can include dynamic quiz_id by using params. The way for this is to making an axios request using the id of the param that you want to update and return:

Your code will read like so:

axios.get('http://localhost:3000/attempt/${quiz_id}', quiz_id);
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