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

This question was also answered by me in the Larachat slack forum, and for others sake here is the answer for the next one with such a problem.

Just a little back story. In the chat we found out that it was receiving a 301 error which is a redirect error. I had the same error recently when posting to a url on a staging server, it was working fine locally but not on the staging server.

The problem appeared to be a slash at the end of the post url.

So posting to https://example.com/post/to/ will not work.

Removing the / and posting to https://example.com/post/to will work.