In the HTTP request process, GET request: The form parameter is appended to the URL in the form of name=value&name1=value1;
Post request: The form parameter is in the request body and is also in the form of name=value&name1=value1 in the request body.
When a post form requests a commit, the content-type used is application/x-www-form-urlencoded, and the POST request that uses the native AJAX does not specify the request header Requestheader, The default content-type used is text/plain;charset=utf-8.
Content-type default value of form in HTML: content-type:application/x-www-form-urlencoded
If you use an AJAX request and the request payload in the requester header causes the parameter to change, the solution is:
Headers: {' content-type ': ' application/x-www-form-urlencoded '}
Or use AJAX settings:
$.ajaxsetup ({contentType: ' application/x-www-form-urlencoded '});
In this way, the problem can be solved.
The difference between form data and request payload in AJAX requests