Retrieve POST parameters only (Java)

前端 未结 6 2050
深忆病人
深忆病人 2021-01-04 10:03

Does anyone know of a way to get only POST parameters from an HttpServletRequest object?

IE, PHP has the $_POST superglobal and Perl\'s CGI.pm will only retrieve POS

6条回答
  •  情歌与酒
    2021-01-04 10:51

    I'm not sure if this would work, but you could try extracting the raw content of the POST body using request.getReader(). The container may remove that data before handing control to your application, though, and even if it didn't, you'd have to decode the parameter string yourself.

提交回复
热议问题