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

159
Visualizações
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
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