Axios post cannot pass boolean using qs

  1. originally, because the axios post request backend could not receive the data, I searched the online solution.
  2. push to use QS,QS so that the backend can receive the number. But what I want to pass is boolean data, and what I receive in the background is string,. I printed the result of this.$qs.stringify () , which is different from JSON.stringify () .
  3. excuse me, how can I send boolean data to the background?
Apr.27,2021

http essentially sends text.
text does not exist type, it is all text, so what is received in the background is a key whose value is "true" , rather than a Boolean true . If the front and rear end does not agree, it can only pass a structure with a data type, such as sending a json to the backend. Json has a data type and can pass boolean

.
Menu