invalid operands of types 'const char*' and 'const char [8]' to binary 'operator+'
Posted: Mon Mar 16, 2020 8:50 pm
if (camClient.connect(postHost, postHttpPort))
{
uint8_t num = 1;
String base64image = "id=7292&num=" + num + "&image=" + (base64::encode(fb->buf, fb->len));
Serial.println("connection");
camClient.println("POST /test/image/post.php HTTP/1.0");
camClient.println("Host: cloud.****.com");
camClient.println("Accept: */*");
camClient.println("User-Agent: Mozilla/5.0");
camClient.println("Content-Length: " + base64image.length());
camClient.println("Content-Type: image/jpeg" );
camClient.println();
camClient.write(base64image.c_str());
//Serial.println(base64_encode_expected_len(fb->len) + 1);
//Serial.println(base64image.length());
camClient.stop();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
How can i fix this?
Error: invalid operands of types 'const char*' and 'const char [8]' to binary 'operator+'
{
uint8_t num = 1;
String base64image = "id=7292&num=" + num + "&image=" + (base64::encode(fb->buf, fb->len));
Serial.println("connection");
camClient.println("POST /test/image/post.php HTTP/1.0");
camClient.println("Host: cloud.****.com");
camClient.println("Accept: */*");
camClient.println("User-Agent: Mozilla/5.0");
camClient.println("Content-Length: " + base64image.length());
camClient.println("Content-Type: image/jpeg" );
camClient.println();
camClient.write(base64image.c_str());
//Serial.println(base64_encode_expected_len(fb->len) + 1);
//Serial.println(base64image.length());
camClient.stop();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
How can i fix this?
Error: invalid operands of types 'const char*' and 'const char [8]' to binary 'operator+'