Hello,
I am trying to use Apache NiFi InvokeHTTP processor to send/upload file and json to Rest API.
I am able to send file using POSTMAN (screen shot attached below).
But in NiFi I could not find any way to attach file in request, so I tried forming request body manually with json data and file content, but getting below error -
Request header :-
Content-Type:multipart/form-data; boundary=12345
Request body :-
--12345\r\n
Content-Disposition: form-data; name="dataFields"\r\n
Content-Type: application/json; charset=utf-8\r\n
{"subtaskId": "task123",
“requestRefId": "request456",
"firstName": "Mahendra",
"lastName": "Hegde"
}
\r\n
--12345\r\n
Content-Disposition: form-data; name="file"; filename="file1.csv"\r\n
Content-Type: text/csv\r\n
\r\n
user,dev,name,lastname,age
abcd,1122,Mahendra,Hegde,32
abcd,1122,Mahendra,Hegde,32
\r\n
\r\n
--12345--\r\n
Error respone :-
{"errors":[{"title":"Error extracting message data [missing file object].","detail":"Error extracting message data [missing file object].","code":"ERROR_INTEGRATION-MANAGER_DECODE_ERROR"}]}

Anyone knows how to use InvokeHTTP for multipart?
Thanks
Mahendra