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");