I'm creating a REST service which returns some computed values back to the client. Netty is very performant at doing this. However, there are cases, when I need to return multiple values for the same URI (query). Here are the approaches we considered: i) Package all the values into a custom format which the clients must know how to decode. ii) Use MIME multipart support.
Approach ii) is much cleaner and is in line with the REST methodology. Is it just me, or I find it hard to figure out how to do this in Netty ?
I went through the File Upload example cited in the Netty documentation. But I cannot figure out how to do the same for in-memory data ?
Any leads / ideas ?
I know it's an old question, but if still needed: If I understand, you want to send multiple values with the same name back as a MIME multipart content, right ?
HttpDataFactory (probably setting useDisk to False if you want to saty in memory)HttpPostRequestEncoder with multipart set to trueencoder.addBodyAttribute(name, value) where value is the only one changingThat should do what you want?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With