示例#1
0
        public bool Delete(ServerDto serverDto, string tenant, OidcClientDto oidcClientDto, Token token)
        {
            tenant = Uri.EscapeDataString(tenant);
            var clientId = Uri.EscapeDataString(oidcClientDto.ClientId);
            var url      = string.Format(_serviceConfigManager.GetOidcClientEndPoint(), serverDto.Protocol, serverDto.ServerName, serverDto.Port, tenant, clientId);

            ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };
            var requestConfig = new RequestSettings
            {
                Method = HttpMethod.Delete,
            };
            var headers = ServiceHelper.AddHeaders(ServiceConstants.JsonContentType);
            var json    = "access_token=" + token.AccessToken + "&token_type=" + token.TokenType.ToString().ToLower();
            var result  = _webRequestManager.GetResponse(url, requestConfig, headers, null, json);

            return(string.IsNullOrEmpty(result));
        }