Accessing the raw body of a PUT or POST request

前端 未结 3 1860
鱼传尺愫
鱼传尺愫 2020-11-28 23:43

I am implementing a RESTful API in Grails, and use a custom authentication scheme that involves signing the body of the request (in a manner similar to Amazon\'s S3 authenti

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 00:41

    It seems that the only way to be able to have continued access both to the stream and request parameters for POST requests is to write a wrapper that overrides the stream reading as well as the parameter access. Here is a great example:

    Modify HttpServletRequest body

提交回复
热议问题