Exemple #1
0
        /// <summary>
        /// Converts the request from a <see cref="IAdsmlSerializable{TResult}"/> of <see cref="XElement"/> into a url-encoded <see cref="string"/>.
        /// </summary>
        /// <param name="request">The request to encode.</param>
        /// <returns>A url-encoded string representation of the request.</returns>
        private string BuildRequest(string request)
        {
            var queryString = request;

            queryString = System.Web.HttpUtility.UrlEncode(queryString, Encoding.UTF8);
            queryString = string.Format("xml={0}&user={1}&password={2}", queryString, _userName, PasswordEncoder.EncodePassword(_password));

            return(queryString);
        }
Exemple #2
0
        /// <summary>
        /// Converts the request from a <see cref="IAdsmlSerializable{TResult}"/> of <see cref="XElement"/> into a url-encoded <see cref="string"/>.
        /// </summary>
        /// <typeparam name="TRequest">The type of the request.</typeparam>
        /// <param name="request">The request to encode.</param>
        /// <returns>A url-encoded string representation of the request.</returns>
        private string BuildRequest <TRequest>(TRequest request)
            where TRequest : class, IAdsmlSerializable <XElement>
        {
            var queryString = request.ToAdsml().ToString();

            queryString = System.Web.HttpUtility.UrlEncode(queryString, Encoding.UTF8);
            queryString = string.Format("xml={0}&user={1}&password={2}", queryString, _userName, PasswordEncoder.EncodePassword(_password));

            return(queryString);
        }