Handle HTTP response more elegantly.