Esp32 ->data ingestion via POST

I am looking to use the data ingestion api to collect audio data (short segments of machine sounds from a woodshop) and sent it by http(s) POST.

So far…

I have successfully run the data ingestion c++ example via win10 WSL2 linux.

Any suggestions for changes that might be needed to run it via esp-idf or arduino framework?

Any HTTP library should work there, e.g. if you’re also using the Arduino IDE.

This is how we do it on another target:

    httplib::Client cli("");
    httplib::Headers headers = {
        { "x-api-key", API_KEY },
        { "x-file-name", "linuxtest01.cbor" },
        { "x-label", "linuxtest" },
        { "x-disallow-duplicates", "1" },
        { "content-type", "application/cbor" }
    // you can replace 'training' here with 'testing'
    auto http_res = cli.Post("/api/training/data", headers, (const char*)buffer, len, "application/cbor");
    printf("Uploaded data, status=%d, body=%s\n", http_res->status, http_res->body.c_str());

Here buffer is the data in Edge Impulse data acquisition format, and len is the length of the buffer.