fetch.addHeader() crashes Get-request
kkuez opened this issue · 2 comments
Hi maakbaas and thank you for that awsome work so far, making our all lifes much easier I bet.
When I make a Get Request and add a header, the ESP crashes for no for me chasable reason.
Wemos d1 Mini
PlatformIO
`LittleFS.begin();
configManager.begin();
WiFiManager.begin("test", 60000);
WiFiManager.setNewWifi("xxx", "xxx");
timeSync.begin();
const char *host = "https://xxx:7777/xxx/get";
fetch.addHeader("x1", "x1");
fetch.addHeader("x2", "x2");
int httpCode = fetch.GET(host);
if (httpCode == HTTP_CODE_OK)
{
while (fetch.busy())
{
if (fetch.available())
{
Serial.write(fetch.read());
}
}
}
else
{
Serial.println(httpCode);
}
fetch.clean();`
The ESP Exception Decoder doesnt help me either.
Might this be cuz of too few memory left?
Ah, got it, had to first .begin() the fetch class, as written in the fetch.md.
You may close this issue now, thx.
Perfect! Thanks for letting me know.