示例#1
0
 private void LogResponse(HttpResponseMessage response, IHttpCallLogHelper webCallLogger)
 {
     webCallLogger?.Response(response.Headers.Select(x => new KeyValuePair <string, string>(x.Key, string.Join(",", x.Value))),
                             _cookieContainer.GetCookies(_httpClient.BaseAddress)//new Uri(TestConfig.ServerURL))//TODO: it is possible that not all cookies will be extracted, still will work for vast majority of cases
                             .Cast <Cookie>()
                             .Select(x => new KeyValuePair <string, string>(x.Name, x.Value)),
                             response.Content.ReadAsStringAsync().Result, response.StatusCode);
     webCallLogger?.Dispose();
 }
 private void LogResponse(HttpResponseMessage response, IHttpCallLogHelper webCallLogger)
 {
     webCallLogger?.Response(response.Headers.Select(x => new KeyValuePair <string, string>(x.Key, string.Join(",", x.Value))), new Dictionary <string, string>(),
                             response.Content.ReadAsStringAsync().Result, response.StatusCode);
     webCallLogger?.Dispose();
 }