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.
TE
andTrailer
is very rarely used, I've actually never seen it in real world code. The servlet API has builtin support for chunked responses (even more, it sends that by default when you don't set the response's content length). But it doesn't have builtin support for chunked response trailers. As an alternative, you could set the desired trailer's value as a custom response header instead (only if the value is US-ASCII compatible and does not exceed a certain max length). – Dung