[
I need to send the CSV file as in the attached image approach. I used the below steps to achieve this,
createMimeData (empty MimeData)
addMimeHeader (Content-Type=multipart/form-data, Accept = application/json, Authorization=Bearer token)
getString (used to get the file data in string format)
stringToStream (used to convert the string to inputStream format)
addBodyPart (map the MimeData, inputStream to content, isEnvStream is yes, and mimeHeader, create the ImportRequest (JSON format), content-type = application/json).
getEnvStream (used to get the envSteam)
http (URL is API URL, method is post, in the data map the envStream to mimestream and bearer key to auth token)
it returns 400 bad request,
I verified to add streamToString and it return the data as,
Date: Wed, 20 Mar 2024 15:57:06 -0500
Message-ID:
MIME-Version: 1.0
Content-Type: multipart/form-data
Accept: application/json
Authorization: Bearer 1221313122
------=_Part_32_1212321–
Date: Wed, 20 Mar 2024 15:57:06 -0500 (CDT)
Message-ID:
MIME-Version: 1.0
content-type: text/plain
content-transfer-encoding: 7bit
SAP Account ID, Company Name, Street Address, Street Address 2, City, State, Zip, Country, Industry, Owner: SAP Account ID, Company Name
1, Test Company
------=_Part_32_1212321–
Can you please help with this?
Thanks,
#Integration-Server-and-ESB#webMethods