Function perform_http_request() has been improved.