esp_http_client PUT method

Ian777
Posts: 21
Joined: Sun Jun 17, 2018 11:31 pm

esp_http_client PUT method

Postby Ian777 » Thu Jan 17, 2019 12:21 am

Hey everyone,

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));
}
I know I must just be missing it, but any help will really be appreciated!

Thanks in advance!

Who is online

Users browsing this forum: No registered users and 131 guests