Now Chatting

Hello, can I help you with anything?


Response headers are added in different places:

  • Server: added by IIS.
  • X-AspNet-Version: added by System.Web.dll at the time of Flush in HttpResponse class
  • X-AspNetMvc-Version: Added by MvcHandler in System.Web.dll.
  • X-Powered-By: added by IIS

To remove the Server header we add the following method and code to the Global.asax.cs file in the WebAPI project:
protected void Application_PreSendRequestHeaders(object sender, EventArgs e)

To remove the X-AspNet-Version header ensure that the Web.config has the following xml:

      <httpRuntime enableVersionHeader="false" />

To remove X-AspNetMvc-Version, go to Global.asax, find/create the Application_Start event and add a line as follows:

protected void Application_Start()
      MvcHandler.DisableMvcResponseHeader = true;

To remove the X-Powered-By header ensure that the Web.config has the following xml:

            <remove name="X-Powered-By" />

To suppress all the other headers ensure that the Web.config contains the following xml:

          <suppressVersionHttpHeaders enabled="true" />

If the header value shows Microsoft-HTTPAPI/2.0 then add a DisbableServerHeader REG_DWORD with a value of 1 to the following:


This requires the HTTP.SYS service to be restarted


Servlet 2.5; JBoss5.0/JBossWeb2.1

PHP Version