I'm trying to work with ArduinoHttpClient and ArduinoJson.
The problem I'm having is that when I get the json document out of httpclient.getresponse() that because its a string it creates a lot of overheard for the size of the json document when I then need to copy the json document into deserializeJson(). Their documentation suggests that I use http.getStream seen here: https://arduinojson.org/v6/how-to/use-arduinojson-with-httpclient/ but there doesn't seem to be an equivalent way to do this. What's the best way to avoid this issue?
This code produces this error:
deserializeJson() failed: NoMemory
String response = http.getresponse();
Serial.println(statusCode);
Serial.println(http.responseBody());
//calculated from here: https://arduinojson.org/v6/assistant/
// create the json object to store my data i'm getting back
DynamicJsonDocument doc(512);
// Deserialize the JSON document
DeserializationError error = deserializeJson(doc, response);
// Test if parsing succeeds.
I'm trying to work with ArduinoHttpClient and ArduinoJson.
The problem I'm having is that when I get the json document out of httpclient.getresponse() that because its a string it creates a lot of overheard for the size of the json document when I then need to copy the json document into deserializeJson(). Their documentation suggests that I use http.getStream seen here: https://arduinojson.org/v6/how-to/use-arduinojson-with-httpclient/ but there doesn't seem to be an equivalent way to do this. What's the best way to avoid this issue?
This code produces this error:
deserializeJson() failed: NoMemory