Adding a response headering using HttpListenerResponse object

I’m trying to do some networking with my Panda II and the FEZ Connect shield. I’ve found that having a locally running HTML file and JavaScript has problems getting data via jQuery from my device. I need to add the following header to my responses:

I cannot, however figure out how to add this to my response object. There’s an “add()” method that shows up in Visual Studio, but I can’t find in the documentation. The online documentation doesn’t have ANY information I can find about how to add the header, and just shows a “get()” and a “set()” method:

What should I do here?

@ gallamine
I’ve used this recently to add “location” header to my response, but I’m at work now and don’t remember the exact syntax I used. I believe I did this:

myResponse.Headers["<my header name>"] = "<my header value>";

I ended up using this function:

response.Headers.Add("Access-Control-Allow-Origin: *");

Sadly, the “add()” method is undocumented. That was frustrating.

When will there be the option of leaving comments on the documentation webpage? That would be helpful!

@ gallamine It is documented.

If you click here to see the “Headers” property of HttpListenerRequest:

And then click on the “WebHeaderCollection” base class link:

And then click the “WebHeaderCollection Members” link, you will find the documentation you are looking for.