#define MaxHeaderLength 16 //maximum length of http header required
String HttpHeader = String(MaxHeaderLength);
//initialize variable
HttpHeader="";
char c = client.read();
//read MaxHeaderLength number of characters in the HTTP header
//discard the rest until \n
if (HttpHeader.length() < MaxHeaderLength)
{
//store characters to string
HttpHeader = HttpHeader + c;
}
//if HTTP request has ended
if (c == '\n') {
// show the string on the monitor
Serial.println(HttpHeader);
//clearing string for next read
HttpHeader="";
}