easy:SetOpt_TrailerFunction(trailer_callback[, userdata])
The callback function looks like this:
res, list = trailer_callback([userdata]) |
The return value can either be #CURL_TRAILERFUNC_OK or
#CURL_TRAILERFUNC_ABORT which would respectively instruct libcurl to
either continue with sending the trailers or to abort the request.
The trailing headers must be stored as strings in a table and the strings
must not be CRLF-terminated, because libcurl will add the appropriate line
termination characters after each header item. Your callback function
must return the table containing the trailers as the list return value.
If one of the trailing header fields is not formatted correctly it will be ignored and an info message will be emitted.
If you pass the optional userdata
argument, the value you pass in userdata will be passed to your callback function as
a parameter. The userdata parameter can be of any type.