Ask a Question
Back to All

POST requests add base64 on multipart/form-data when file is referenced in the payload

Recently users have been complaining that some of the examples from the documentation are not working.

Previously when a file was attached to the payload (multipart/form-data), it was attached the following way:

curl -X POST "https://api.emysound.com/api/v1/Tracks" -H "accept: application/json" -F "[email protected]_not_go.wav;type=audio/x-wav"

Since latest updates, it attaches it the following way:

curl --request POST
--url https://api.emysound.com/api/v1/Tracks
--header 'Accept: application/json'
--header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001'
--form MediaType=Audio
--form 'file=data:audio/x-wav;name=do_not_go.wav;base64 <ENTIRE BASE 64 OF THE FILE>

The difference is in the file form:
Previous: --form "[email protected]_not_go.wav;type=audio/x-wav"
Right now: --form "file=data:audio/x-wav;name=do_not_go.wav;base64 <ENTIRE BASE 64 OF THE FILE>"

Notice how it attaches base64 on the entire file which triggers errors on the server side since no base64 payload is expected, rather path to the file.

Is there any way to enable back previous behavior?