the postJSON method around line 300 should be write to a writer instead of returning the body as a readCloser