我正在使用arduino HTTPClient在ESP32中进行发布请求。谁能帮助我在其中发布图像文件以及一些数据的部分。
以下代码仅发送user_name和image_type-
即可正常工作#include <HTTPClient.h>
http.begin("https://www.somelink.com/post-image");
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
String httpRequestData = "user_name=Shidhartha&image_type=Outdoor";
int httpResponseCode = http.POST(httpRequestData);
if(httpResponseCode > 0){
String response = http.getString();
Serial.println(response);
}else{
Serial.print("Error on sending POST: ");
Serial.println(httpResponseCode);
}