Gadgeteer WebServer Response error on the client side

Hi to everyone! I run the Gadgeteer WebServer on Fez Raptor. I am using a responder.Respond() method to send a response to windows PC client side. I use Ad-Hoc connection between PC and Raptor via WIFI RS 21 module.

Here is a code:

WebEvent status = WebServer.SetupWebEvent("status");
status.WebEventRecived+= status_WebEventRecieved;

void status_WebEventRecieved(string path, WevServer.HttpMathod method, Responder responder)
    byte[] data = System.Text.Encoding.UTF8.GetBytes("status");

WebEvent fires with no problem on Raptor side, but client side response event handler that expects System.Net.Http.HttpResponseMessage with text/html content type never fires.

Here is Ad-Hoc connection code i use:

WiFiRS9110.NetworkParameters ACCESSPOINT_PARAMS = new WiFiRS9110.NetworkParameters();
            ACCESSPOINT_PARAMS.Key = "";
            ACCESSPOINT_PARAMS.Ssid = "RaptorBOT";
            ACCESSPOINT_PARAMS.NetworkType = WiFiRS9110.NetworkType.AdHoc;
            ACCESSPOINT_PARAMS.SecurityMode = WiFiRS9110.SecurityMode.Open;
            wifiRS21.NetworkInterface.EnableStaticIP("", "", "");

What is the problem? Should i convert the Gadgeteer response on the client side somehow? Or Ad-hoc connection doesn’t allow to send Respond?

the format of your response text is not html.

1 Like

@ Mike -
You are right… Thank you!!! I forgot to change response format on the client side. Before i used text/html. Responder uses text/plain for string type.