Exemplo n.º 1
0
        public Uri CreateSubmitUrl(Formular formular)
        {
            var builder = new UriBuilder();

            builder.Scheme = FormElement.Document.Url.Scheme;
            builder.Host   = FormElement.Document.Url.Host;
            builder.Port   = FormElement.Document.Url.Port;
            builder.Path   = FormElement.GetAttribute("action");
            builder.Query  = string.Join("&", BuildParameters(formular));

            return(builder.Uri);
        }
Exemplo n.º 2
0
        public Uri CreateSubmitUrl(Formular formular)
        {
            var builder = new UriBuilder();

            builder.Scheme = FormElement.Document.Location.Scheme;
            builder.Host   = FormElement.Document.Location.Host;
            builder.Port   = FormElement.Document.Location.Port;
            builder.Path   = FormElement.GetAttribute("action");
            builder.Query  = string.Join("&", BuildParameters(formular));

            var urlString = builder.ToString();

            // we have to use obsolete API here to force Uri class to NOT encode our string - it is already encoded.
            // if we let Uri class do the default for a strange reason the Url gets reencoded - sometimes.
#pragma warning disable 618
            return(new Uri(urlString, true));

#pragma warning restore 618
        }