如何列出所有OWIN键及其值,类似于Request.ServerVariables
中的WebForms:
foreach(string k in Request.ServerVariables)
{
Debug.WriteLine("{0}: {1}", k, Request.ServerVariables[k]);
}
发布于 2016-07-11 19:25:31
我想我会发现这是谷歌,但没有;代码是相当直截了当的深入研究后,IntelliSense。它是基于owinContext.Environment.Keys
的
var owinContext = HttpContext.GetOwinContext();
foreach (string k in owinContext.Environment.Keys)
{
Debug.WriteLine("{0}: {1}", k, owinContext.Environment[k]);
}
https://stackoverflow.com/questions/38314663
复制相似问题