Menu

#67 Addition of trailer headers in requests generated by libcurl

open
nobody
None
2013-01-15
2013-01-09
No
Support the addition of trailer headers in requests generated by libcurl.

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.

Discussion

  • Dan Fandrich

    Dan Fandrich - 2013-01-09

    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.

     
  • Datsios Chrysovalantis

    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.

     
  • Dan Fandrich

    Dan Fandrich - 2013-01-09

    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!

     
  • Datsios Chrysovalantis

    Hi, I've thought that this feature should be something like another option in curl_easy_setopt() fuction.

    Example:

    struct curl_slist *trailer_http_hdrs;
    trailer_http_hdrs = curl_slist_append(trailer_http_hdrs, "myTrailer: blabla");
    curl_easy_setopt(curl, CURLOPT_HTTPTRAILERHEADER, trailer_http_hdrs);
    

    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?

     

Log in to post a comment.