To test your
LedController server with a client that runs on a computer, use the test client given in Example 12-4, which sends a PUT request to the server. You need to adapt the constant
uri to the address of your device.
The representation sent to the server is contained in constant
message. See what happens if you send the value as given below, or if you change it to
false or some unsupported value.
This code won’t run on a Netduino Plus. You’ll have to run it on Windows using .NET, or on Mac OS X or Linux using Mono. Mono is an open source implementation of .NET that runs on several platforms.
Example 12-4. LedControllerClient test client in C#
using System; using System.IO; using System.Net; using System.Text; using System.Threading; ...