Form Data with URL

Is there a way to add prefilled form data with juce url post requests? I’m attempting to create something with a file upload equivalent to this in curl:

curl -X ‘POST’ ‘https://api.ourapp.com/upload’ -H ‘accept: application/json’ -H ‘Content-Type: multipart/form-data’ -F ‘file=@test.wav;type=audio/basic’

In juce I’ve been trying various combinations of URL.withFileToUpload and similar but haven’t found the right combination.

    URL tempURL = URL(uploadUrl).withFileToUpload("file", File(waveFile), "audio/basic");
    tempURL = tempURL.withPOSTData("file=@test.wav;type=audio/basic");
    auto inputStream = tempURL.createInputStream(false, progressCallback, this, "Content-Type: multipart/form-data", -1, nullptr, nullptr, 5, "POST");
        lgFlURL = lgFlURL.withParameter("prm", "val");
        lgFlURL = lgFlURL.withFileToUpload("file", fl.fileObj, "application/octet-stream");

        j::StringPairArray responseHeaders;
        int statusCode{0};
        std::unique_ptr<j::InputStream> stream2 (lgFlURL.createInputStream (j::URL::InputStreamOptions (j::URL::ParameterHandling::inPostData)
                                                                            .withConnectionTimeoutMs(6000)
                                                                            .withStatusCode(&statusCode)
                                                                            .withResponseHeaders(&responseHeaders)
                                                                            .withProgressCallback(webRequestProgressCallback)
                                                                            ));
        if(stream2!=nullptr)
        {
                  auto serverResponseStr  = stream2->readEntireStreamAsString();
                  DBG(serverResponseStr);
        }