开发者

Grails Http Post

开发者 https://www.devze.com 2022-12-10 02:10 出处:网络
I am unable to read the body of a post to my开发者_运维百科 grails controller. This error is thrown

I am unable to read the body of a post to my开发者_运维百科 grails controller. This error is thrown

Caused by: java.lang.IllegalStateException: STREAMED

when I call

request.getReader()

There are some posting on message boards that say to add

parseRequest:true

To the URL mapping. I have done this with no change. Any Help?


Are you using a multipart form to uplod a file?

If you are, you can just call request.getFile() as Grails will have already read the input stream for you an create a MultipartRequest object.

If it's just a normal post, you might have to user request.getInputStream() instead of getReader as some other code has already called getInputStream() (which is why when you call getReader() it throws an exception).

cheers

Lee

0

精彩评论

暂无评论...
验证码 换一张
取 消