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: http://www.ghielectronics.com/downloads/NETMF/WIZnet%20Library%20Documentation/html/f4fd09d1-8db8-44c2-dc62-590174f1494a.htm
What should I do here?
jasdev
January 4, 2012, 5:40pm
2
@ 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!
jasdev
January 5, 2012, 11:31am
4
@ gallamine It is documented.
If you click here to see the “Headers” property of HttpListenerRequest:
[url]http://www.ghielectronics.com/downloads/NETMF/WIZnet%20Library%20Documentation/Index.html[/url]
And then click on the “WebHeaderCollection” base class link:
[url]http://www.ghielectronics.com/downloads/NETMF/WIZnet%20Library%20Documentation/Index.html[/url]
And then click the “WebHeaderCollection Members” link, you will find the documentation you are looking for.