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

160
Views
problema con axios obtener error 400 mala solicitud

He estado atascado durante bastante tiempo porque cuando lanzo una llamada a mi API para recuperar datos (por lo tanto, un método GET) tengo un error de solicitud incorrecta 400 en el cartero. Logro recuperar los datos en el estado 200. Sin embargo, en mi axios Paso los parámetros así como los encabezados útiles.

Codigo axios estado 400 :

 async getAssociatedPlant() { this.$axios.$get('lnk/plant/plants', { headers: { "Content-Type": "application/json", }, params: { link: "good", plant_id: this.plantActive.id, }, }) .then(response => { console.log(response) }).catch(error => { console.log(error) }); },

Imagen útil para entender:

Estado de los encabezados del cartero 200 OK

Estado de parámetros de cartero 200 OK

Erreur 400 mala solicitud

Solicitar carga útil

Solicitar respuesta

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Intente agregar datos:{} a la configuración de su solicitud.

 async getAssociatedPlant() { this.$axios.$get('lnk/plant/plants', { headers: { "Content-Type": "application/json", }, data:{}, params: { link: "good", plant_id: this.plantActive.id, }, }) .then(response => { console.log(response) }).catch(error => { console.log(error) }); }
about 4 years ago · Juan Pablo Isaza 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!