Add a 'chunked' parameter to writeBody to determine if it should send the data chunked, instead of reading from the headers.