Basically my response headers contain
Transfer-encoding=chunked,
Trailer=[some trailer I want to send say e.g “SomeTrailer”]
Once I’m done writing the data to the Servlet outputstream, I’m writing the trailer
“SomeTrailer:[value]”, but this is not being parsed by the httpclient correctly.
The httpclient considers the whole of inputstream (including the trailer) as a single
chunk.
I’ve also tried writing the trailer in a response header after the data has been written to the outputstream but without success.
Please help
I haven’t found any good sources on this.
I ended up writing a simple single threaded webserver for this. Turned out it was quite easy. The server is pretty simple. The code’s a bit rough though, but the main idea is there.
What it does it sends the filecontents as the first chunk and the checksum of the file as a footer.