I am using Power Automate Desktop to call a POST - API with accepts multipart/form-data. In the body of the requist I send various data as string values. This data is interpreted correctly, the receiving api get the correct values.
One of the parameters I can set is a file. For this file I can also provide data, e.g. I want to upload a pdf.
If I send the filecontents as a variable, then the created file is larger than the source file, it seems as if the bytes sent are interpreted as characters. If I open both the original file and the created file in an editor, they seem to be identical, but I believe the original file to depict the bytes and the created file to be the character representation of the same bytes (and therefore the file is larger).
If I try to send it with base64 and content-transfer-encoding: base64 the created file contains the characters of the base64 representation and again is not equal to the original pdf.
If I try to send the binary data (convert file to binary data), the created file only contains the characters bytes [number of bytes] and is very small.
What is the correct way to use multipart/form-data to create / upload the binary contents of a file?
Any help is appreciated.