res should be checked against nil before access its fields, because send_request_cgi can return nil in case of timeout.