예제 #1
0
        public ShellWebConnection(
            IWebConnection webConnection,
            WebMethod method,
            string url,
            byte[] content,
            string contentType,
            CookiesFromBrowser cookiesFromBrowser,
            CallingFrom callingFrom)
            : base(webConnection.WebServer, callingFrom, webConnection.Generation + 1)
        {
            _Content = new WebConnectionContent.InMemory(content);
            _ContentType = contentType;
            _Session = webConnection.Session;
            _Method = method;
            _CookiesFromBrowser = cookiesFromBrowser;
            _CookiesToSet = webConnection.CookiesToSet;
            _HttpVersion = webConnection.HttpVersion;
            _RequestedHost = webConnection.RequestedHost;
            _Headers = new Dictionary<string, string>(webConnection.Headers);
            _MimeReader = webConnection.MimeReader;

            BaseWebConnection = webConnection;

            DetermineRequestedFileAndGetParameters(url);
            TryDecodePostParameters();
        }
예제 #2
0
        public ShellWebConnection(
            IWebConnection webConnection,
            ISession session,
            string requestedFile,
            RequestParameters getParameters,
            byte[] content,
            string contentType,
            CookiesFromBrowser cookiesFromBrowser,
            CallingFrom callingFrom)
            : base(webConnection.WebServer, callingFrom, webConnection.Generation + 1)
        {
            _Content = new WebConnectionContent.InMemory(content);
            _ContentType = contentType;
            _Session = session;
            _Method = WebMethod.GET;
            _CookiesFromBrowser = cookiesFromBrowser;
            _CookiesToSet = webConnection.CookiesToSet;
            _HttpVersion = webConnection.HttpVersion;
            _RequestedHost = webConnection.RequestedHost;
            _Headers = new Dictionary<string, string>(webConnection.Headers);
            _MimeReader = webConnection.MimeReader;

            BaseWebConnection = webConnection;

            _RequestedFile = requestedFile;
            _GetParameters = getParameters;
            _PostParameters = null;
        }
예제 #3
0
        /// <summary>
        /// Constructor for when a web request is generated publicly instead of externally
        /// </summary>
        /// <param name="webServer"></param>
        /// <param name="session"></param>
        /// <param name="url"></param>
        /// <param name="content"></param>
        /// <param name="contentType"></param>
        /// <param name="cookiesFromBrowser"></param>
        /// <param name="callingFrom"></param>
        /// <param name="method"></param>
        public ShellWebConnection(
            IWebServer webServer,
            ISession session,
            string url,
            byte[] content,
            string contentType,
            CookiesFromBrowser cookiesFromBrowser,
            CallingFrom callingFrom,
            WebMethod method)
            : base(webServer, callingFrom, 0)
        {
            _Content = new WebConnectionContent.InMemory(content);
            _ContentType = contentType;
            _Session = session;
            _Method = method;
            _CookiesFromBrowser = cookiesFromBrowser;
            _CookiesToSet = new List<CookieToSet>();
            _HttpVersion = 1;
            _RequestedHost = null;
            _Headers = new Dictionary<string, string>();

            DetermineRequestedFileAndGetParameters(url);

            TryDecodePostParameters();

            if (null == BaseWebConnection)
                BaseWebConnection = this;
        }