コード例 #1
0
        /// <summary>
        /// Builds the URL to call the web service.
        /// </summary>
        /// <param name="parameters">The list of parameters to add to the query.</param>
        /// <returns>The URL to make the call with.</returns>
        protected Uri BuildUri(NameValueCollection parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            var urlBuilder = new UriBuilder(
                new Uri(
                    new Uri(BaseMtgUrl),
                    string.Concat(_version.GetDescription(), "/", _endpoint.GetDescription())));

            var query = HttpUtility.ParseQueryString(urlBuilder.Query);

            query.Add(parameters);
            urlBuilder.Query = query.ToString();

            return(urlBuilder.Uri);
        }
コード例 #2
0
 public static string GetRequestUrl(Base service, Api api, ApiVersion version, Endpoint endpoint)
 {
     return($"{service.GetDescription()}{api.GetDescription()}/{version.GetDescription()}/{endpoint.GetDescription()}");
 }