Fix httpclient.py so that all tests pass