In the process of JS development today, there is a strange problem, that is, when using AJAX to send a POST request to the back end, when viewing response in the browser network, display the "request" and "get", because I am not a front-end, So very confused, looking for answers without results, has ruled out not JSONP cross-domain request (it is said that the JS cross-domain only get request, if the POST request will be converted to get request)
A variety of search, see a very old post, is the same problem, and there is a netizen also turned to this a few years ago, and left a message, said is because the static resource file URL and the backend service URL duplicate name, such as the backend service URL is/api/v1/take_case, Front-End Static resource folder path is/api/v1/take_case/this will cause the problem above, in the back-end URL to add a/, the front end also use the corresponding URL.
My reality is that the matching URL in the Django urls.py file is/api/v1/take_case/, but the interface to me is/api/v1/take_case
At the end add one / post to solve the problem
The exact reason is that one, please self-test
Use Ajax in jquery to send a POST request into a GET request