I need help with my project. Here is my code:
void ConexaoServer(){
uint8_t buffer[1024] = {0};
if (wifi.createTCP(HOST_NAME, HOST_PORT)) {
Serial.print("Conexao com o Host OK!\r\n");
} else {
Serial.print("Conexao com o Host com ERRO!\r\n");
}
char *ComandoGET = "GET /teste HTTP/1.1\r\nHost: SmartHome\r\nConnection: close\r\n\r\n";
wifi.send((const uint8_t*)ComandoGET, strlen(ComandoGET));
uint32_t len = wifi.recv(buffer, sizeof(buffer), 10000);
if (len > 0) {
Serial.print("Received:[");
for(uint32_t i = 0; i < len; i++) {
Serial.print((char)buffer[i]);
}
Serial.print("]\r\n\r\n");
}
}
And i receive from Node.js in Serial
Received:[HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 4
ETag: W/"4-wArb1VtkpsN6In8g50pGNw"
Date: Wed, 31 Aug 2016 01:26:41 GMT
Connection: close
Luiz]
But i want to receive just "Received:[Luiz]". How i can do this?
Thanx!