I'm currently programming in VUE.
This is a endpoint I made with fastAPI to add a location
In order to add locatons from my component, I created a function in my VUE component called fetchNewLocation
:
I tested my endpoint before with swagger ui, and everything works correctly:
However, when I try to execute the function that uses AXIOS, I get the 422 Unprocessable Entity
Error:
Also in my response, it doesn't seem like the paramters reached the backend at all:
I also tried fetch
as an alternative to AXIOS
, but I still got the 422
Error.
Honestly at this point, I'm out of options. I know for sure that the paramters I give in the function are valid strings, and the endpoint is so simply constructed that I don't see potential for any other mistake I could have made. I also use AXIOS in another function to send a GET
request, and that works for whatever reason.
If my PUT
works in swagger ui, why not in AXIOS? What did I do wrong?
Access-Control-Allow-Origin
is a response header, it does not belong in your request