Monday, January 15, 2024

Help with Vue.js post request


full image - Repost: Help with Vue.js post request (from Reddit.com, Help with Vue.js post request)
Hello, I am developing a web application using vue.js for the frontend and Java Spring for the backend but I am facing some weird issues while trying to dockerize the application and I would really appreciate any kind of help! The issue is that while running the application with Docker my POST endpoint does not seem to work, even though it works fine while running it with "npm run dev" but every other endpoint I have works just fine in both. After running a POST request, the console shows three things: 1) The request was blocked by CORS due to cross-origin, which is expected since it does not seem to recognize the backend respective endpoint and gets blocked. However, the backend has the annotation CrossOrigin with the correct port so it shouldn't be a problem (and it isn't with the rest of the endpoints) 2) The request get an Unsupported Media Type error since it weirdly does not get matched with the JSON format that the backend endpoint accepts or the header that I provide in the axios.post method itself. 3) The request itself seems to have no Content-Type nor Content-Length header set which is weird since I provide it with data?? I have provided all related code and hopefully someone can help! I don't know if this is a Docker configuration error or a code-specific one, but I don't think its the former since every other endpoint works? Thank you in advance! The backend model Java Spring Backend Endpoint The method in the Country Service Class The view responsible for post request The view component script The form that is used by the previous component The data of the form API for post request using axios The console errors The network errors The docker compose file. (Assume also postgres component that works correctly)


Mining:
Bitcoin, Cryptotab browser - Pi Network cloud PHONE MINING
Fone, cloud PHONE MINING cod. dhvd1dkx - Mintme, PC PHONE MINING


Exchanges:
Coinbase.com - Stex.com - Probit.com


Donations:
Done crypto



Comments System

Disqus Shortname

Disqus Shortname

designcart
Powered by Blogger.