public void GetWebRequestWithProxy() { var request = HttpRequestTest.SetContent(); request.WebProxy = new WebProxy(); var httpWebRequest = HttpResponse.GetWebRequest(request); }
public void GetWebRequestWithIgnoreCertificate() { var request = HttpRequestTest.SetContent(); request.SetHttpsInsecure(true); var httpWebRequest = HttpResponse.GetWebRequest(request); }
public void GetWebRequestWithProxy() { HttpRequest request = HttpRequestTest.SetContent(); request.WebProxy = new System.Net.WebProxy(); HttpWebRequest httpWebRequest = HttpResponse.GetWebRequest(request); }
public void GetWebRequestWithProxy() { var request = HttpRequestTest.SetContent(); request.WebProxy = null; var httpWebRequest = HttpResponse.GetWebRequest(request); Assert.NotNull(httpWebRequest); }
public void GetWebRequestWithTimeout() { var request = HttpRequestTest.SetContent(); var httpWebRequest = HttpResponse.GetWebRequest(request); Assert.Equal(5000, httpWebRequest.Timeout); Assert.Equal(10000, httpWebRequest.ReadWriteTimeout); request.SetConnectTimeoutInMilliSeconds(1024); request.SetReadTimeoutInMilliSeconds(2048); httpWebRequest = HttpResponse.GetWebRequest(request); Assert.Equal(2048, httpWebRequest.ReadWriteTimeout); Assert.Equal(1024, httpWebRequest.Timeout); }
public void GetWebRequest() { var request = HttpRequestTest.SetContent(); var httpWebRequest = HttpResponse.GetWebRequest(request); Assert.IsType <HttpWebRequest>(httpWebRequest); Assert.Equal("application/octet-stream", httpWebRequest.ContentType); request.Headers.Add("Accept", "accept"); request.Headers.Add("Date", "Thu, 24 Jan 2019 05:16:46 GMT"); request.Method = MethodType.POST; httpWebRequest = HttpResponse.GetWebRequest(request); Assert.IsType <HttpWebRequest>(httpWebRequest); Assert.Equal("application/octet-stream", httpWebRequest.ContentType); }