Refine http_client.py