Typically, the front end submits data to the server via a POST request in 4 format, "application/x-www-form-urlencoded" format, "multipart/form-data" format, "Application/json" Format and "Text/xml" format. Often the most common is the "Application/json" format, which is the form of a JSON string.
The data you see in the console is this:
Sometimes the background needs form form of data in order to parse normally, so the front end needs to change the format when passing through. At first I thought it was to modify the Content-tyoe property, so I
Axios.defaults.headers = { ' content-type ': ' application/x-www-form-urlencoded '}
When you see the request, the content-type becomes the application/x-www-form format, but the data does not change. After looking for a long time finally found the real method.
First step: Introduce Axios PS
Step two: Using the QS Conversion
Then look at the request data format as follows:
Use Axios to send a POST request to change the JSON data to form type