Beispiel #1
0
        /// <summary>
        /// Sends a request to the IceWarp Api
        /// </summary>
        /// <typeparam name="T">An implementation of IceWarpResponse</typeparam>
        /// <param name="url">The IceWarp server url</param>
        /// <param name="command">The Api request command</param>
        /// <returns>The response from IceWarp</returns>
        /// <exception cref="IceWarpApiException">An error occurred when calling the Api</exception>
        /// <exception cref="IceWarpErrorException">An error returned from the IceWarp Api</exception>
        public T Execute <T>(string url, IceWarpCommand <T> command) where T : IceWarpResponse
        {
            var response = _httpUtility.PostAsXml(url, command.ToXml().OuterXml);

            return(command.FromHttpRequestResult(response));
        }