writing http client in java