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

196
Vistas
How do I can get response data after I post it?

I want to get data (= user id) after I post How to I store a response data to variable..?

   async function start() {
    const req = {
      'user-num': count,
    };
    const response = await axios.post(NumURL, { req });
    setState(response.data);
    // userid(response.data);
    console.log(response.data);
    // return data  
  }

I want to get the response data... and the backend api just give json format like {"user-id" : 3}

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

It means that you are only sending user-id from the backend, however if you can search the user after getting the user id, fetch the data again from the server on the specific endpoint eg:

setState(response.data);
const response = await axios.get(`NumURL/${id}`, { req });
setState(response.user);

just do the get request again on the specific endpoint, after getting the id.

about 4 years ago · Santiago Trujillo 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