Joe Cannatti
Joe Cannatti

Reputation: 5079

Grails Http Post

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?

Upvotes: 0

Views: 848

Answers (1)

leebutts
leebutts

Reputation: 4882

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

Upvotes: 2

Related Questions