Esempio n. 1
0
        public override string ComposeUrl(string endpoint, Dictionary <string, string> queries)
        {
            Dictionary <string, string> mapQueries = (queries == null) ? QueryParameters : queries;
            StringBuilder urlBuilder = new StringBuilder("");

            urlBuilder.Append(Protocol);
            urlBuilder.Append("://").Append(endpoint);
            if (null != this.uriPattern)
            {
                urlBuilder.Append(RoaSignatureComposer.ReplaceOccupiedParameters(uriPattern, pathParameters));
            }
            if (-1 == urlBuilder.ToString().IndexOf('?'))
            {
                urlBuilder.Append("?");
            }
            else if (!urlBuilder.ToString().EndsWith("?"))
            {
                urlBuilder.Append("&");
            }
            string query = ConcatQueryString(mapQueries);
            string url   = urlBuilder.Append(query).ToString();

            if (url.EndsWith("?") || url.EndsWith("&"))
            {
                url = url.Substring(0, url.Length - 1);
            }
            return(url);
        }
Esempio n. 2
0
 private void Initialize()
 {
     this.AcceptFormat = FormatType.RAW;
     this.Composer     = RoaSignatureComposer.GetComposer();
 }