0

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?

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

I think i'll look into using a multipart post. I'll give it a shot on monday and let you know. I have already tried getinputstream() and it returns an empty stream. thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.