Hello!
I've been at this for a couple of days and I'm having trouble understanding a solution. I'm doing an http request on my esp8266 expecting a json file that i'll parse for later use. But the problem I'm encountering is that the "http.getString()" returns only a sliver of the json file. I'm having a hard time finding documentation regarding size of the return and I'm at my wits end.
Here is the relevant parts of the code:
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char *ssid = "xxx";
const char *password = "xxx";
const char* serverName = "http://............";
WiFiClient wifiClient;
.
.
.
.
void setup(){
Serial.begin(115200);
WiFi.begin(ssid, password);
while ( WiFi.status() != WL_CONNECTED ) {
delay ( 500 );
Serial.print ( "." );
}
Serial.println("Wifi Connected");
}
void loop() {
int urgency;
String jsonFile;
HTTPClient http;
http.begin(wifiClient, serverName);
int httpResponseCode = http.GET();
if (httpResponseCode>0) {
Serial.print("HTTP Response code: ");
Serial.println(httpResponseCode);
jsonFile = http.getString();
Serial.println(jsonFile);
}
delay(10000);
}
The usual length of a response I'm expecting could be roughly 12000 chars but I'm usually only getting < 10%
Is there another way to get the data, maybe as a bytestream or anything else. As long as i can get the full message.