예제 #1
0
 internal static object GetRequestTrackingForDebug(RequestManager requestManager, string databaseName)
 {
     return requestManager.GetRecentRequests(databaseName).Select(x =>
     {
         var dic = new Dictionary<String, String>();
         foreach (var httpHeader in x.Headers.Value)
         {
             dic[httpHeader.Key] = httpHeader.Value.First();
         }
         dic.Remove("Authorization");
         dic.Remove("Proxy-Authorization");
         dic.Remove("WWW-Authenticate");
         dic.Remove("Proxy-Authenticate");
         
         return new
         {
             Uri = x.RequestUri,
             Method = x.HttpMethod,
             StatusCode = x.ResponseStatusCode,
             RequestHeaders = dic.Select(z=>new{Name = z.Key, Values= new[]{z.Value}}),
             ExecutionTime = string.Format("{0} ms", x.Stopwatch.ElapsedMilliseconds),
             AdditionalInfo = x.CustomInfo ?? string.Empty
         };
     });
 }
예제 #2
0
		internal static object GetRequestTrackingForDebug(RequestManager requestManager, string databaseName)
		{
			return requestManager.GetRecentRequests(databaseName).Select(x => new
			{
				Uri = x.RequestUri,
				Method = x.HttpMethod,
				StatusCode = x.ResponseStatusCode,
				RequestHeaders = x.Headers.AllKeys.Select(k => new { Name = k, Values = x.Headers.GetValues(k) }),
				ExecutionTime = string.Format("{0} ms", x.Stopwatch.ElapsedMilliseconds),
				AdditionalInfo = x.CustomInfo ?? string.Empty
			});
		}