<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