Closed phonicmouse closed 8 years ago
Very simple:
HTTPClient client("IP", PORT); //client.debug(1);
// FILE is the return STREAM type of the HTTPClient char Uri[255]="..."; FILE* result = client.getURI(Uri);
int returnCode = client.getLastReturnCode();
if (returnCode==NULL) { //Error }
if (result!=NULL) { int c; response=""; while ((c = fgetc(result)) != EOF) { response+=(char) c; //Serial.print((char) c); } if (ferror(result)) { //error }
//Serial.println("");
client.closeStream(result); // this is very important -- be sure to close the STREAM
}
thanks.
@Apollon77 only one thing...where do you get the response char?
response is simply declared as String
ok thanks ;)
@interactive-matter @Apollon77 how to do that? Please help me..