Question about ChunkedMessageEnd

35 views
Skip to first unread message

Leon Ma

unread,
Mar 9, 2015, 5:34:15 AM3/9/15
to spray...@googlegroups.com

Hi,

In ChunkedMessageEnd definition:


case class ChunkedMessageEnd(extension: String = "",
                             trailer: List[HttpHeader] = Nil) extends HttpRequestPart with HttpResponsePart with HttpMessageEnd {


What's the purpose for extension and trailer (how does they impact on the final output)?

If I generate some HttpHeader in trailer, will these headers finally output to browser?


Thanks
Ma Ling


Mathias Doenitz

unread,
Mar 9, 2015, 5:48:44 AM3/9/15
to spray...@googlegroups.com
Leon,

the trailer headers are a feature of HTTP (http://tools.ietf.org/html/rfc7230#section-4.1.2), which spray must support in order to be able to call itself HTTP-compliant.
My impression is that trailer headers aren’t that widely used in the wild (similarly to chunk extensions) but I might be wrong.
Maybe someone else can comment on a real-world use case?

Cheers,
Mathias

---
mat...@spray.io
http://spray.io
> --
> You received this message because you are subscribed to the Google Groups "spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spray-user.
> To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/eb8bfb2e-d4a5-40e5-86b0-ebb22e361f84%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Leon Ma

unread,
Mar 9, 2015, 8:29:57 AM3/9/15
to spray...@googlegroups.com
Thanks a lot !

Then maybe I can use the trailer header to store some statistics like total size of all chunks.


在 2015年3月9日星期一 UTC-7上午2:48:44,Mathias写道:
Reply all
Reply to author
Forward
0 new messages