Use Ajax in jquery to send a POST request into a GET request

Source: Internet
Author: User
Tags file url

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.