I’m know expert but it look slike to me your Thread.Sleep is in the wrong place.
public static void ProcessRequest(string requestUri, int count)
{
// var request = (HttpWebRequest)WebRequest.Create(requestUri);
// Thread.Sleep(250); // suggested by http://www.tinyclr.com/forum/2/5313/
using (var request = (HttpWebRequest)WebRequest.Create(requestUri))
{
request.Method = "GET";
// send request and receive response
// !!!!!! Wrong place? Thread.Sleep(1250); // suggested by http://www.tinyclr.com/forum/2/5313/
using (var response = (HttpWebResponse)request.GetResponse())
{
// !!!!! The line above is where the request is made so wait here for return
Thread.Sleep(1250);
Debug.Print("have a response, consuming....");
// consume response
HandleResponse(response, count);
}
}
}
Please keep in mind that different platforms might not be 100% compatible code-wise. and I guess the book that you are referring to was specifically made for Netduino. So please try to avoid to use the same example code in this book with FEZ Panda II. For example the networking library, http class and the hardware is completely different.
We have a lot of examples online. Here where you need to start:
Here is a full project that uses HTTP on FEZ Panda II and FEZ Connect and as I remember it uses GET:
[quote]WIZnet W5100 HTTP FileServer:
Here is a example that has been adopted from NETMF SDK examples (…\Documents\Microsoft .NET Micro Framework 4.1\Samples\HttpServer) and edited to get it working with W5100 sockets libraries and the SD card. Only minor addition is needed as you can see because the W5100 libraries made to be compatible with the original System.Net libraries.
The example runs on FEZ Panda II or FEZ Domino with FEZ Connect and a microSD card with few files.
When the devices IP address is access from the web browser, the page will show the files on the microSD card.[/quote]