fix HTTPClient.write()
add unit test for HTTPClient.write()
fix spec compliance of HttpClient.setHeader()
add unit test for HttpClient.setHeader()