Hello,
When a POST call is made with the "form-data" and a file is attached with a file name, how to read the content of the file attachment?
Ex: In a POST call, when a file is attached with file name 'request_body' and the content of the file is a JSON payload, we need to read just the JSON payload within the file.
We tired the below code to achieve it, but we get some extra details along with the file content content
String incomingfile = lisa_vse_request.getBodyText();
testExec.setStateValue("fileContent", incomingfile);
The Output is as below:
----------------------------972913604387560689945330
Content-Disposition: form-data; name="requestFile"; filename="request_body"
Content-Type: application/json
{
"name": "Alice Brown",
"sku": "54321",
"price": 199.95,
"shipTo": {
"name": "Bob Brown",
"address": "456 Oak Lane",
"city": "Pretendville",
"state": "HI",
"zip": "98999"
},
"billTo": {
"name": "Alice Brown",
"address": "456 Oak Lane",
"city": "Pretendville",
"state": "HI",
"zip": "98999"
}
}
----------------------------972913604387560689945330--
Expected Result:
Only the content of the file attached in the API request.
How to achieve this feature? Do we have any option other than the SDPH?
Thank you