2013-02-18 32 views
0

HTTPServletRequest包含以下信息。現在如何讀取的HttpServletRequest的該請求頭部的內容類型是application/X WWW的窗體-urlencoded在Java

headers: 
    Accept-Encoding: gzip, deflate 
    X-Chargify-Webhook-Signature: b048ad28f573829f52f05208aa522a6f 
    X-Chargify-Webhook-Id: "8233897" 
    Content-Type: application/x-www-form-urlencoded 
    Accept: "*/*; q=0.5, application/xml" 
    Content-Length: "47" 
body: payload[chargify]=testing&id=8233897&event=test 

,如何讀取身體身體從請求和身體分爲鍵/值對?

回答

0

Servlet service()方法有HttPServlerRequest對象。

通過使用該Request對象調用request.getParameter(paramName),你可以從請求對象獲得價值

Refference

相關問題