Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!