I've experimented with a web server response thingamajig and this code works :
void handleDigitalWrite(){
String message = "OK\n\n";
String portString = server.argName(0);
message += portString;
message += "pin is set to:";
int portnr = portString.toInt();
String stateString = server.arg (0);
message += stateString;
int statenr = stateString.toInt();
digitalWrite(portnr,statenr);
server.send (200, "text/plain", message );
}
I wonder if there is a other way to do this.