A bit related to THIS other topic:
But any good solutions for constructing and posting a multipart-mime message to a remote HTTP server?
I have use cases where I want to take several “fields” alo...
I didn’t try this with a real server, only with https://putsreq.com/, but both options seemed to send the right data. The problem with the FileWriter is that it sends a PUT, not a POST. For the REST Post version, I used BinaryToDocument to convert the output of the MultipartWriter to a document configured the REST Post as follows:
Upload body type – “Binary”
Entity – Base64.decodeAsBinary($content)
HTTP Headers – Content-Type | $['content-type']
Here’s a screenshot of what was received by putsreq.com:
That seems right, but there might be something I’m missing. The FileWriter version seemed right as well, there was a Content-Type header with the boundary that matched what was in the body.
I’m attaching the REST Post version of the pipeline, which reads the CSV files from an SLFS directory and combines them with a MultipartWriter: