Separate the debug code from the function http_request().