Axios's post request for 415 unsupported media type, and 400 Bad Request

the axios, used starts at 415 and is changed to the request header "Content-Type":"application/json;charset=utf-8". After the request header, it begins to report 400.
the upper parameter is originally like this

.

clipboard.png

clipboard.png
for some unknown reason, the interface keeps reporting 400

.
Mar.14,2021

I haven't used axios, but let me help you configure it.

clipboard.png

configure source

you can try this configuration to see if you can prevent request's payload from being modified


when the upper parameter sent by axios is an array, the backend will not receive the parameter, and the request header can keep 'Content-Type':'application/x-www-form-urlencoded; charset=utf-8'.

then convert the array to be uploaded into a string using JSON.stringify (arr)

Menu