HTTP - 多个预告标题

dev*_*bmw 3 http rfc2616 chunked-encoding http-headers

我试图在我的服务器中实现HTTP,并且无法找到有关如何处理多个拖车头字段(使用分块编码)的任何信息.

标准(http://tools.ietf.org/html/rfc2616#section-14.40)指出:"预告片一般字段值表示给定的标题字段集合存在于使用分块传输编码的消息的预告片中 -编码."

但是没有说明如何在此Trailer标头中指定多个标头.

例如,如果一个请求或响应有两个拖车头,Example1并且Example2,你将如何构建的Trailer头?

像这样:Trailer: Example1 Example2或者Trailer: Example1,Example2还是什么?

Nis*_*röm 9

来自RFC 2616:

14.40 Trailer

       Trailer  = "Trailer" ":" 1#field-name

2.1 Augmented BNF

#rule
   A construct "#" is defined, similar to "*", for defining lists of
   elements. The full form is "<n>#<m>element" indicating at least
   <n> and at most <m> elements, each separated by one or more commas
   (",") and OPTIONAL linear white space (LWS).

换句话说,你应该写:

Trailer: Example1, Example2

请注意,RFC 2616已被废弃: