Hi, could use some help, As a response to a Http GET I receive the following;
startedRequest ok
Got status code: 200
Content length is: 316
Body returned follows:
"postId": 11,
"id": 52,
"name": "esse autem dolorum",
"email": "Abigail.OConnell@june.org",
"body": "et enim voluptatem totam laudantium\nimpedit nam labore repellendus enim earum aut\nconsectetur mollitia fugit qui repellat expedita sunt\naut fugiat vel illo quos aspernatur ducimus"
Using this code...
char c;
while ( (http.connected() || http.available()) &&
((millis() - timeoutStart) < kNetworkTimeout) )
{
if (http.available())
{
c = http.read();
// Print out this character
Serial.print(c);
I would like to extract the name from this text as a char but have no idea where to begin. Thx
I don't think so, looks like the third line of the body is required.
I'd read it char by char into an array and whenever you see a comma search that buffer for "name":. If it's found, the remainder of the buffer is the content you're looking for. If not, reset the buffer index before reading more.