How can you list out all OWIN keys and their values, similar to Request.ServerVariables
in WebForms:
foreach(string k in Request.ServerVariables)
{
Debug.WriteLine("{0}: {1}", k, Request.ServerVariables[k]);
}
答案 0 :(得分:0)
I thought I would find this Googling but did not; the code is pretty straight forward after digging in with IntelliSense. It is based on owinContext.Environment.Keys
var owinContext = HttpContext.GetOwinContext();
foreach (string k in owinContext.Environment.Keys)
{
Debug.WriteLine("{0}: {1}", k, owinContext.Environment[k]);
}