Support for encoding HTTP message trailers?

pkwarren pkwarren at gmail.com
Thu Aug 6 12:18:10 EDT 2009


On Thu, Aug 6, 2009 at 1:48 AM, Trustin Lee (via Nabble)
<ml-user+57722-154022124 at n2.nabble.com> wrote:
> Could you let me know what is your use case of the trailing header?
> That would help me to find the best way to add support for trailing headers.

We are sending back CIM-XML over HTTP
(http://www.dmtf.org/standards/published_documents/DSP0200_1.3.0.pdf)
and using chunking to send back results immediately. If any errors
occur while sending back results, the response body is truncated and
then trailing headers are used to indicate an error.

The workflow today looks like:
- Send DefaultHTTPResponse with 'Trailers' http header and
transfer-encoding=chunked.
- Send 0-* DefaultHttpChunks until the final chunk (which may contain headers).
- Send final chunk which has an empty body and any accumulated
trailing headers. To get this to work, I wrote my own HttpTrailers
class and added an encoder to the pipeline which writes it out.

--
Philip K. Warren
pkwarren at gmail.com

-- 
View this message in context: http://n2.nabble.com/Support-for-encoding-HTTP-message-trailers--tp3364513p3399222.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list