Assignment of String into StreamString?
Posted: Sun Mar 24, 2019 4:34 pm
I could not find a way to assign a String object to a StreamString object - I am getting a HTTP response from a HTTPClient.getString() call that is supposed to go into a StreamString object. I tried several variants, but I always will receive the "error: conversion from 'String' to non-scalar type 'StreamString' requested" error. The code snippet below shows the offending line ("StreamString owmdata..."):
StreamString does inherit both the String and Stream classes, and any String=String assignment will work, so why does this fail?
Code: Select all
owm.begin(OWM_URL);
int HTTPrc = owm.GET();
if(HTTPrc)
{
StreamString owmdata = owm.getString();
Serial.printf("HTTP status: %d\n", HTTPrc);