1、使用axios.get方式发送无参请求
<script src="https://unpkg.com/axios/dist/axios/main.js"></script>
<script>
axios.get('http://localhost:9999/student/student/getAllStudent').then(res=>{
console.log(res)
}).catch(err=>{
console.log(err)
})
</script>
2、使用axios.get方式发送有参请求
<script src="https://unpkg.com/axios/dist/axios/main.js"></script>
<script>
axios.get('http://localhost:9999/student/student/findStudentById',{params:{id:1}}).then(res=>{
console.log(res)
}).catch(err=>{
console.log(err)
})
</script>
3、使用axios.post方式发送