请问request.getParameter("username");是怎样拿值的

请问request.getParameter("username");是怎样拿值的
就是当发送from表单时request.getParameter("username");是可以拿值的。但是当axios发送post请求request.getParameter("username");拿到的是null,而且必须得用@RequsetBody才能拿到

抓包看下,这个需要客户端发送的请求里的post data有username=xxx才能获取

axios post 默认是直接把 json 放到请求体中提交到后端的吧

axios发送post请求封装成json格式了,所以必须通过RequestBody去拿。