コード例 #1
0
        private HttpWebRequest SendWebRequest(HTTPTestCase httpTestCase, string RequestMethod, NameValueCollection collHeader)
        {
            HttpWebRequest webrequest = null;
            HTTPBaseClass  BaseHttp   = null;

            BaseHttp = new HTTPBaseClass(httpTestCase.Username, httpTestCase.Password, httpTestCase.ProxyServer
                                         , httpTestCase.Target, RequestMethod, collHeader);
            bool allowRedirect = (!string.IsNullOrEmpty(httpTestCase.RedirectLocation)) ? true : false;
            bool isNetworkCred = (!string.IsNullOrEmpty(httpTestCase.Username) &&
                                  !string.IsNullOrEmpty(httpTestCase.Password)) ? true : false;

            return(webrequest = BaseHttp.CreateWebRequest(isNetworkCred, allowRedirect));//false indicates: Http non-secure request
        }