I am new to esp32, I am using arduino HTTPClient to push code into esp32do the post request in ESP32. Can anyone help me with the code using whichpart where I will be able to post an image file along with some data in the server using esp32.
I have tried this codeThe below but still it does notcode works for me.perfectly fine with only sending user_name and image_type-
static esp_post_img()
{
esp_err_t res = ESP_OK;
esp_http_client_handle_t#include http_client;<HTTPClient.h>
esp_http_client_config_t config_client = {0};
config_clienthttp.url = post_url;
config_clientbegin("https://www.event_handler = _http_event_handler;somelink.com/post-image");
config_client
http.method =addHeader("Content-Type", HTTP_METHOD_POST;"application/x-www-form-urlencoded");
String http_clienthttpRequestData = esp_http_client_init(&config_client);"user_name=Shidhartha&image_type=Outdoor";
int esp_http_client_set_post_field(http_client,httpResponseCode post_data,= strlenhttp.POST(post_data)httpRequestData);
esp_http_client_set_headerif(http_client,httpResponseCode "Content-Type",> "image/jpg"0);
{
esp_err_tString errresponse = esp_http_client_performhttp.getString(http_client);
if Serial.println(err == ESP_OKresponse) ;
}else{
Serial.print("esp_http_client_get_status_code"Error on sending POST: ");
Serial.println(esp_http_client_get_status_code(http_client)httpResponseCode);
}