示例#1
0
        private Url GetUrl(Uri uri)
        {
            var url = new PostMan.Url
            {
                Raw             = uri.OriginalString,
                Protocol        = uri.Scheme,
                Host            = uri.Host.Split('.'),
                Path            = SegmentsWithoutSlash(uri),
                Port            = uri.Port.ToString(),
                QueryParameters = GetQuery(uri)
            };

            return(url);
        }
        private Url GetUrl(Uri uri)
        {
            var url = new PostMan.Url
            {
                Raw             = uri.OriginalString,
                Protocol        = uri.Scheme,
                Host            = uri.Host.Split('.'),
                Path            = SegmentsWithoutSlash(uri),
                Port            = uri.Port.ToString(),
                QueryParameters = GetQuery(uri)
            };

            if (uri.Scheme?.ToLower() == "http")
            {
                if (uri.Port == 80)
                {
                    url.Port = null;
                }
            }

            return(url);
        }