I've been looking at the esp_http_client , specifically the PUT method. I plan on using a persistent session with POST and PUT. Post will be used to login and logout from a DB. The PUT method I want to use to pass a file to the Database. The file will be stored locally on a SDcard. I can't seem to see how I could configure the file handle or something along those lines when using the PUT method.
Here's the esp-idf example I'm referring to: https://github.com/espressif/esp-idf/bl ... _example.c
Line 102 - 112 shows the method in question:
Code: Select all
//PUT
esp_http_client_set_url(client, "http://httpbin.org/put");
esp_http_client_set_method(client, HTTP_METHOD_PUT);
err = esp_http_client_perform(client);
if (err == ESP_OK) {
ESP_LOGI(TAG, "HTTP PUT Status = %d, content_length = %d",
esp_http_client_get_status_code(client),
esp_http_client_get_content_length(client));
} else {
ESP_LOGE(TAG, "HTTP PUT request failed: %s", esp_err_to_name(err));
}
Thanks in advance!