axios({
url:"xxxx/findStudentByName",
method:'post'
data{
name:zhangsan /* post request*/}
params:{
name:zhangsan /* data post date 会进行url拼接,不推荐*/}}).then(res=>{
console.log('res')});/* data post JSON 后台控制器接收到的name是null axios使用post携带参数默认使用application/json
解决方式一:使用param进行参数传递
解决方式二:“name=张三”
解决方式三:服务器端给接受的参数加上@requestBody*/
//use post wihout date<script>
axios.post("https.........").then(res=>{
console.log(res);}).catch(err=>{
console.log('timeout');})</script>
//use post request with date
axios.post("https:...../findStudentByName","name=zhangsan").then(
res=>{
console.log(res);}).catch(err=>{
console.log('timeout');})