public static HttpResponse ToHttpCall(this WebRequest request)
        {
            var result = request.BeginGetResponse(r => { }, null);
            try
            {
                var response = request.EndGetResponse(result).As<HttpWebResponse>();
                return new HttpResponse(response);
            }
            catch (WebException e)
            {
                var errorResponse = new HttpResponse(e.Response.As<HttpWebResponse>());
                Debug.WriteLine(errorResponse.ToString());

                return errorResponse;
            }
        }
Пример #2
0
 protected override void beforeLine()
 {
     _driver = new EndpointDriver(_urls.Value);
         _invocation = new EndpointInvocation();
         _response = null;
 }