I've hit a roadblock for some time now while trying to make a call to my API to fetch data using the GET method. I keep getting a 400 bad request error in Postman, even though I am able to successfully retrieve the data with a status code of 200. I have double-checked that I am passing all the necessary parameters and headers correctly in my Axios code.
A snippet of the Axios code showing the 400 status error:
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)
});
},
Image links for better understanding :