no match for 'operator=' (operand types are 'String' and 'void') : iv been stuck on this for two days...
i am querying a webpage that returns a json string using a nodeMCU ESP8266 microcontroller. response from the webpage looks like this:

`{"1":true,"2":false,"3":false,"4":true,"5":true,"6":false,"7":false,"8":false}`

the code i am using looks like this:

    #include <ESP8266WiFi.h>
    #include <ESP8266HTTPClient.h>
    #include <ArduinoJson.h>
    String payload = "";
    const char* ssid = "ssid";
    const char* password = "password";
    String url = "example.com/data.json";
    void setup() {
      Serial.begin(115200);
      delay(2000); while (!Serial);
    
      WiFi.begin(ssid, password);
      while (WiFi.status() !=WL_CONNECTED){
        delay(500);
        Serial.print(".");
      }
      Serial.println(WiFi.localIP());
      pinMode(D0, OUTPUT);
    }
    void loop() {
      StaticJsonBuffer<100> jsonBuffer;
      delay(5000);
      HTTPClient http;
      http.begin(url);
      int httpCode = http.GET();
      Serial.println(httpCode);
      Serial.println(http.getString());
      if (httpCode > 0) {
        payload = http.getString();
      }
      http.end();
      JsonObject& root = jsonBuffer.parseObject(payload);
      Serial.println(payload);
      if(!root.success()) {
        Serial.println("parseObject() failed");
      }
      if(root["1"] == true) {
        Serial.println("true");
      }
      digitalWrite(D0, !digitalRead(D0));
    }

i believe the reason it fails to parse is that the payload variable ends witth a trailing newline character. i then attempted `payload = payload.trim();` but then i get `no match for 'operator=' (operand types are 'String' and 'void')` so i tried `payload = payload.replace("\n,"");` same issue, then i tried `payload = String(payload);` again, failure. what am i doing wrong?