Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get a "Platform Not Supported Exception" while adding new Response Header?

Why do I get a "Platform Not Supported Exception" while adding a new Response Header? I am debugging a website using Visual Studio web server.

Response.Headers["X-XRDS-Location"] = url

Exception Message:

This operation requires IIS integrated pipeline mode.

Any help would be appreciated.

like image 636
Software Enthusiastic Avatar asked May 07 '09 05:05

Software Enthusiastic


People also ask

How do you set a response header?

Select the web site where you want to add the custom HTTP response header. In the web site pane, double-click HTTP Response Headers in the IIS section. In the actions pane, select Add. In the Name box, type the custom HTTP header name.

How do I get the response header value?

The getResponseHeader() method returns the value as a UTF byte sequence. Note: The search for the header name is case-insensitive. If you need to get the raw string of all of the headers, use the getAllResponseHeaders() method, which returns the entire raw header string.


1 Answers

Response.Headers.Add() works only in IIS7 integrated pipeline mode. Use Response.AddHeader() instead. This method will work on all platforms.

like image 146
Levi Avatar answered Oct 15 '22 00:10

Levi