Vue's Ajax request uses the Axios component, which results in the backend (Python language +django framework) not receiving when it uses the POST request and discovers that it is transmitting data to the background.
The request.body in the background shows that what I'm transmitting is that data was bundled into a key value in obj by Django, and value is an empty array. Causes the background to be fetched.
Solution:
Axios ({ method: ' POST ', url:ap_service_url+opt.url, data:opt.obj, transformrequest: [Function ( Data) {Let ret = "for" Let it in data) {ret + = encodeURIComponent (it) + ' = ' + encodeURIComponent (Data[it]) + ' & ' return ret }], headers:{' content-type ': "Application/x-www-form-urlencoded"}}). Then (function (res) {/ * request succeeds */}). catch (function (err) {/ * request failed */})
Successfully jump out of this pit by adding transformrequset ~
Vue:axios of Post requests in the