Se si vuole fare il parsing dell’argomento passato su un url e’ molto efficace il metodo toCharArray() della classe String.

    EthernetClient client = server.available();
if (client){
boolean sentHeader = false;
while (client.connected()){
if (client.available()){
if(!sentHeader){
client.println( “HTTP/1.1 200 OK” );
client.println( “Content-Type: text/html” );
client.println();
sentHeader = true ;
}
char c = client.read() ;
if (readString.length() < 20 )
readString.concat(c) ;
if (c == ‘\n’) {
int Istr = readString.indexOf( “/” ) ;
int Iqu = readString.indexOf(“?”);

Annunci