Skip to content

怎么解析post请求的body呢? #3

Closed

Description

@LiuGangR

如题
只能读取输入流,自己解析?

Activity

  1. 54chen commented on Nov 12, 2014

    @54chen
    Member

    inv可以取出body,如果不是标准的键值对,需要自行解析。

  2. LiuGangR commented on Nov 13, 2014

    @LiuGangR
    Author

    但是spring3.x,都支持requestBody注解了,rose可否支持呢

  3. 54chen commented on Nov 13, 2014

    @54chen
    Member

    暂时没有相关计划。

    2014-11-13 15:16 GMT+08:00 LiuGangR notifications@github.com:

    但是spring3.x,都支持requestBody注解了,rose可否支持呢

    —
    Reply to this email directly or view it on GitHub
    #3 (comment).

    http://www.54chen.com
    http://twitter.com/54chen

  4. bsqql123 commented on Aug 17, 2017

    @bsqql123

    rose原生确实不支持,我自己用拦截器实现了一个类似于Spring 的@RequestBody注解,可以接收application/json请求,可以作为轮子来使用,代码地址:
    https://github.com/bsqql123/paoding-rose-hello/blob/master/src/main/java/net/paoding/rose/samples/hellorose/controllers/IndexController.java

    拦截器实现在这里:
    https://github.com/bsqql123/paoding-rose-hello/blob/master/src/main/java/net/paoding/rose/samples/hellorose/controllers/AccessTrackInterceptor.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions