Arduino Yun Bridge Example

Hi, some days ago I tried the Arduino Yun Bridge example. With this example you are able to make calls to some Web API on the Arduino Yun. But when I tried to make the calls from a browser it don't worked...

When the YunClient object recive the request, it recive an HTTP message with this format GET /index.html HTTP/1.1.... So I had to change the void process(YunClient client) function because it expects to read the command to execute in the first position, but HTTP method will found.

So if you would make this example working you can update the process function with this one (this version is also compatible with no HTTP compliant clients):

void process(YunClient client) {
  String msg;

  // Read cmd
  String command = client.readStringUntil('/');
  if (command=="GET ")                                      // GET /command/params HTTP/1.1
    command = client.readStringUntil('/');
  if (command=="POST ")                                     // POST /command/params HTTP/1.1
    command = client.readStringUntil('/');

    // is "digital" command?
  if (command == "digital") {
    digitalCommand(client);
  }

  // is "analog" command?
  if (command == "analog") {
    analogCommand(client);
  }

  // is "mode" command?
  if (command == "mode") {
    modeCommand(client);
  }
}

I hope that help!

Bye Roby