A simple HTTP client. In fact there are some anti-patterns in this code