<form action="/submit" enctype="text/plain" method="POST"> <p>关键字: <input type="text" name="keyword" /></p> <input type="submit" value="Submit" /> </form>
HTTP请求中,若是是get请求,那么表单参数以key1=value1&key2=value2的形式附到url的后面,若是是post请求,那么表单参数是在请求体中,也是以key1=value1&key2=value2的形式在请求体中。html
post请求的Content-Type为application/x-www-form-urlencoded,参数是在请求体中,即上面请求中的Form Data。后端servlet能够经过request.getParameter("keyword")
获取数据git
Content-Type为text/plain;charset=UTF-8,则请求表单参数在RequestPayload中,后端servlet能够经过org.apache.commons.io.IOUtils.toString(request.getReader())
获取数据。github