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

169
Vistas
How I can fetch the API to display the question

I have started learning about fetch API for few days and my teacher asked me to do it immediately. He said the request for the data is none. and it response that when created successfully, the status is 201 and the new created attempt contains attempt ID and an array of questions in Data(Json). I tried to code but it not works. This is the link of the API: https://wpr-quiz-api.herokuapp.com/attempts

All the description is here. https://wpr-quiz-api.herokuapp.com/

Sorry about my bad English and the code is not so good because I just start learning it. So if you don't mind, please describe as detailed as possible.

Thank you so much

let question=[];
const inputk = document.querySelector('span');
  question.push(inputk.value);
function onResponse(response){
  return response.json();
}
function onsubmit(object){
  const inputk = document.querySelector('span');
 question=object;
}
  fetch("https://wpr-quiz-api.herokuapp.com/attempts")
  .then(onResponse).then(onsubmit)
<form action="https://wpr-quiz-api.herokuapp.com/attempts" method="POST">
  <div>
    <span></span>
  <input type="radio">
    <label>Option 1</label><br>
   <input type="radio">
    <label>Option 2</label><br>
    <input type="radio">
    <label>Option 3</label><br>
  </div>
</form>

about 4 years ago · Juan Pablo Isaza
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