Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Data transfer via nifi api

avatar
Contributor

Hello,

 

how do I properly use the nifi-api to create flowfile from a file? I tried to do what is described here: https://nifi.apache.org/docs/nifi-docs/rest-api/index.html under 'Data transfer'

 

I've tried to use a simple curl command to transfer a file as flowfile to an input port as follows:

curl -X POST -F 'file=@Documents/Nifi_Docs/example.txt' http://10.0.1.111:8080/nifi-api/data-transfer/input-ports/dac743ae-0189-1000-c6a6-efd211a162d1/trans...

 

As response I get a 415 error Unsupported Media Type. What is the supported media type then? Anyone tried this before? What is the transaction id good for? I just put 1010 as a random number.

 

I also tried sending from postman

1 ACCEPTED SOLUTION

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
2 REPLIES 2

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Contributor

Ok, thanks for the info. I thought it would have been an elegant solution to be able to use the nifi-api to transfer files directly to a port. I have tried ListenHTTP, which suits my task perfectly.