typo
Add the writeBodyChunked method.
Pass the headers to writeBody.
Call writeBodyChunked when Transfer-Encoding is "chunked".