How to send encoded image using HTTP POST? ESP32
Posted: Thu Mar 12, 2020 10:32 pm
Hello.
I can’t figure out how to send an image encoded via base64 via HTTP POST.
I encode the image through base64:
Trying to send using HTTP POST:
I can’t figure out how to send an image encoded via base64 via HTTP POST.
I encode the image through base64:
Code: Select all
String base64image = base64::encode(fb->buf, fb->len);
Serial.println(base64image);
Code: Select all
if (!camClient.connect(postHost, postHttpPort))
{
camClient.println("POST /test/image/post.php HTTP/1.0");
camClient.println("Host: cloud.****.com");
camClient.println("Accept: */*");
camClient.println("Content-Length: " + base64image);
camClient.println("Content-Type: image/jpeg");
camClient.println();
return;
}