我知道這很容易,但我不能讓這個工作。我有一個響應標題如下。獲得在asp.net頁面中的破折號響應值頭
X-Exposure-Server:EastUS2
我隨地吐痰出來這樣
<span>@Response.Headers["X-Exposure-Server"]</span>
然而,它是空白。爲什麼?
響應頭
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/8.5
X-AspNetMvc-Version: 5.2
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Exposure-Server: EastUS2
Access-Control-Allow-Origin: *
X-UA-Compatible: IE=Edge,chrome=1
Date: Tue, 19 Apr 2016 04:39:53 GMT
Content-Length: 11017
如何獲取IIS添加的值顯示???? –
這是IIS默認添加的X-Exposure-Server響應標頭嗎?只有可以返回的標準響應標頭(默認),這不是其中之一.chk此鏈接-msdn.microsoft.com/en-us/ library/ms537417(v = vs.85).aspx; IIS可以返回以X-*開頭的4個響應頭,但是你得到的不是這些中的一個。那麼IIS如何返回你提到的頭文件。 –
但我在Chrome Web工具網絡標籤中看到它? –