Support Questions

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

Nifi 1.18 multipart/form-data with binary 'part' and json'part'


Hello, I m sending a http requestto an API and facing some difficulties to configure the multipart specificities.

The 1st part should be binary (gzip) and named (data) and the second part should be json file and named (parameters). this works corretly with post man


but I m not able to do the same thing with Nifi 1.18

this is my workflow








if someone faced this situation, plz share your feedbacks




Community Manager

@bou7miiiz Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @mburgess @MattWho  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Diana Torres,
Community Moderator

Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:


Hi @bou7miiiz ,

Its hard to tell what is wrong from what you provided because you seem to everything setup accordingly but Im not familiar with what type of API you are working with so its hard to tell. First, I would like to know what is happening when you run the InvokeHttp? are you getting an error? what type of error and response code are you getting?

Second, I noticed in Postman you are referencing the json parameters value form a file, did you try to pass the json itself instead because that is what you are doing with Nifi.



thank you for your answer Samsal,

its a rest API via HTTP

the invokHttp is not throwing any error


and m getting a 415 error with an empty response 



and yes when I try to change the file in postman with a text, I get the same error


< 415 Unsupported Media Type
< accept: application/json, application/cbor, application/xml;charset=UTF-8, application/*+json, text/xml;charset=UTF-8, application/*+xml;charset=UTF-8
< cache-control: no-cache, no-store, max-age=0, must-revalidate
< content-length: 0
< content-security-policy: frame-ancestors 'self'
< date: Wed, 06 Mar 2024 09:23:07 GMT
< expires: 0
< pragma: no-cache
< strict-transport-security: max-age=31536000; includeSubDomains; preload
< x-content-type-options: nosniff
< x-frame-options: DENY
< x-xss-protection: 1; mode=block



however, when specifying the content type for the parameters it's working (in postman)


the probleme is that I m not able to specify the second content type "application/json" and it's mandatory either with file or text


This is interesting. I never came across a case where you need to specify the content-type on the form data itself & I cant find anything for that in the invokehttp documentation.  @MattWho , @cotopaul , @joseomjr  do you have any information on this?


When I look into how the type is passed using curl for example, it looks like the following:

--form 'Parameters="...";type=application/json' 

I'm not sure this is going to work but when you set the post:form:parameters value try to append the type to the json string as follows:


If that doesnt help. Im not sure how can you do such thing without using something like ExecuteScript processor and write code like groovy to execute the API call.

I apologize if I did not have straight answer.



unfortunatly it's not working, however if this can help, in Nifi 1.11 i m using a groovy script (I thought that I can avoid it by migrating to 1.18)




@bou7miiiz are you setting the mime type in the post HEADERS from nifi to the api?

The 415 error seems to be expecting "application/json".


Add this property the same way you added Authorization.


how can I add this property to the invokHttp? I should precise that this content-type is only for the json part. the other part should be application/octet-stream

Super Collaborator

What headers do you set inside of Postman?