java获取GET和POST请求参数

URL和参数列表

一 获取请求方式
request.getMethod(); get和post都可用,

二 获取请求类型

request.getContentType(); get和post都可用,示例值:application/json ,multipart/form-data, application/xml等

三 获取所有参数key

request.getParameterNames(); get和post都可用,注:不适用contentType为multipart/form-data

四 获取参数值value

request.getParameter(“test”); get和post都可用,注:不适用contentType为multipart/form-data

五 获取取参数请求集合

request.getParameterMap(); get和post都可用,注: 不适用contentType为multipart/form-data

猜你喜欢

转载自blog.csdn.net/qq_42678668/article/details/114226863