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

156
Views
422 Unprocessable Entity when using axios get request

I'm using axios get to fetch data by sending parameter request body and ran into this issue:

enter image description here

console.log("Submitted!");
console.log(latitude);
console.log(longitude);
axios.get('http://127.0.0.1:8000/api/real-estate/apartment-sale-hanoi-price/predict', {
                        
                        "latitude": latitude,
                        "longitude": longitude
                        
                    })
                    .then(response => {
                        predict_price = response.data.predicted_price;
                        console.log("predicted_price: " + predict_price);
                        /*
                        popup_content = popup_content + `<br>` + `Predicted: ` + predicted_price;
                        selected_marker.bindPopup(popup_content).openPopup();*/
                    })
                    .catch(error => console.log(error));

My API endpoint returns a JSON object containing predicted_price. It worked when I tested on Thunder client

enter image description here

I think it may have something to do with how I pass the parameter body in the get request.

Previously I tried data and params props inside axios but still the same error. Something might have gone wrong on the client side.

I tried many different Content-Type like json, form-data... but nothing worked so far!

enter image description here

Could you show me a way to solve this?

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