Example case: Chuncked PUT request with Trailer headers.
At the last chunk(whose size is 0) there should be the possibility to add HTTP header fields at the end of the message. The "Trailer" header field is used to indicate which header fields are included in a trailer. This way the recipient knows which header fields to expect in the trailer.
Example PUT request:
PUT /myfile HTTP/1.1
Host: 10.8.60.209
Accept: /
Transfer-Encoding: chunked
Trailer: myTrailer
Expect: 100-continue
53
.........
.data..
.........
0
myTrailer: 7895bf4b8828b
Will this feature be supported in a future release?
Thanks,
Chrysovalantis.
Has this feature been standardized or used by any widely-supported server? If not, then it's unlikely that there will be much interest in adding support for it to libcurl when it's unlikely to be used.
Hi, the feature is standarized in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.40
One can also refer at Chris Shiflett's Book "HTTP: Developer's Handbook" from SAMS page 97. http://books.google.gr/books?isbn=0672324547
Trailer headers at the end of a chunked message are helpful for information that cannot be determined until the request has been completely generated.
A common example of it is:
Trailer: Content-MD5
.......
.......
0
Content-MD5: 7895bf4b8828b55ceaf47747b4bca667
Thank you for the immediate response,
Chrysovalantis.
Wow, I've never run into that feature before. I haven't heard of anyone with plans to add such support to libcurl, but seeing that it is in the standard, there probably would be few objections to someone submitting a patch to add it!
Hi, I've thought that this feature should be something like another option in curl_easy_setopt() fuction.
Example:
where CURLOPT_HTTPTRAILERHEADER is the option that adds the trailer headers appended on curl_slist trailer_http_hdrs.
If I manage to add it, where in the curl-library mailing list should I post the diffs in the code and under what subject?