Created 07-22-2024 09:25 PM
Hello, I m sending a http request to an API and facing some difficulties to configure the multipart specificities.
I have to send 2 files as part of request. Is there any way to send 2 files ? Since there can be only one flow file that is possible
Created 07-23-2024 02:34 AM
Hi @SushmaNaya ,
I believe this was asked before here but I dont think there is a way to do it in one shot. you probably have to do it in custom script like executeScript processor where you can have part of the data stored as an attributes (depending how big the part is ) and then the other part is your flowfile content or have both stored as attributes (not recommended). Once you get the flowfile the execute script will get the content of the flowfile and the other aprt form the attribute construct your multi part body and send it that way. By the way if you are using Nifi 2.0 you probably can utilize python extensions to create your own custom processor using pure python when you can use different packages to help you with that. You can find example here: https://community.cloudera.com/t5/Support-Questions/Nifi-1-18-multipart-form-data-with-binary-part-a...
https://www.w3schools.com/python/ref_requests_post.asp
Hope that helps
Created 07-22-2024 09:28 PM
Created 07-23-2024 02:34 AM
Hi @SushmaNaya ,
I believe this was asked before here but I dont think there is a way to do it in one shot. you probably have to do it in custom script like executeScript processor where you can have part of the data stored as an attributes (depending how big the part is ) and then the other part is your flowfile content or have both stored as attributes (not recommended). Once you get the flowfile the execute script will get the content of the flowfile and the other aprt form the attribute construct your multi part body and send it that way. By the way if you are using Nifi 2.0 you probably can utilize python extensions to create your own custom processor using pure python when you can use different packages to help you with that. You can find example here: https://community.cloudera.com/t5/Support-Questions/Nifi-1-18-multipart-form-data-with-binary-part-a...
https://www.w3schools.com/python/ref_requests_post.asp
Hope that helps