Axios/XMLHttpRequest is sending GET instead of POST in production environment

后端 未结 3 2075
猫巷女王i
猫巷女王i 2021-01-02 03:22

I am running into a very strange issue. We are putting an app into production and one of the POST request is turning into a POST followed directly by a GET request to the sa

3条回答
  •  半阙折子戏
    2021-01-02 04:06

    I confirm the previous answer. And I had the same problem from local to production ambience.

    The call to an endpoint like / api / user / store / might be redirect to / api / user / store with a 301 status code and this call was interpreted like a GET that obviously we cant reach (because it not in our route list). So it don't work.

    A solution can be to work on Apache configuration (trim last slash) but I prefer to adapt my Axios call.

提交回复
热议问题