Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Posting multiple files using invokehttp to API using nifi

Highlighted

Posting multiple files using invokehttp to API using nifi

New Contributor

I am having 3 files which i need to post to API end. I am fetching 3 files using FetchHDFS process and  want to pass them to API. How can i pass them.

 

Input:

3 files in HDFS [csv/text]
Content-Type: multipart/form-data

 

Error:

invokehttp.response.body

{ "message": "Multipart: Boundary not found (user: 'undefined')", "level": "error", "timestamp": "2019-12-11T09:59:05.464Z" }

 

workflow tried:

inputPort --> 3 FetchHDFS process to fetch 3 different file --> invokeHttps

1 REPLY 1

Re: Posting multiple files using invokehttp to API using nifi

New Contributor

sample curl command :

 

curl -X POST "https://xxxxxx/xxxxx" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file1=@File1.csv;type=application/vnd.ms-excel" -F "file2=@File2.txt;type=text/plain" -F "file3=@File3.csv;type=application/vnd.ms-excel" -F "format=flat"

Don't have an account?
Coming from Hortonworks? Activate your account here