<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to handle a json body and file in the same request in NiFi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-handle-a-json-body-and-file-in-the-same-request-in/m-p/412665#M253604</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/114561"&gt;@AlokKumar&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for using Cloudera Community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I understand, what you need is to add one more step in your flow:&amp;nbsp;&lt;BR /&gt;HandleHttpRequest-&amp;gt; MergeContent -&amp;gt; ExecuteScript (Groovy)-&amp;gt; HandleHttpResponse&lt;/P&gt;&lt;P&gt;Since you have JSON fields and files, you're getting multiple FlowFiles.&lt;BR /&gt;So this extra MergeContent phase will combine the JSON and the file into a single FlowFile&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the MergeContent, set &lt;STRONG&gt;Merge Strategy&lt;/STRONG&gt;&amp;nbsp;as “Defragment” and set &lt;STRONG&gt;Correlation Attribute Name&lt;/STRONG&gt; as http.request.id. that is unique from each&amp;nbsp;HandleHttpRequest&lt;/P&gt;</description>
    <pubDate>Tue, 14 Oct 2025 18:41:36 GMT</pubDate>
    <dc:creator>vafs</dc:creator>
    <dc:date>2025-10-14T18:41:36Z</dc:date>
    <item>
      <title>How to handle a json body and file in the same request in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-handle-a-json-body-and-file-in-the-same-request-in/m-p/412663#M253602</link>
      <description>&lt;P&gt;Hello I need help how to make a flow which can handle 2 pieces of data from user. Let us consider a scenario-&amp;gt; User submits a form having some fields like name, age, address and also a file having something say a list of his hobbies(just for example). How do we process these together and return a response back?&lt;/P&gt;&lt;P&gt;I have my flow like this HandleHttpRequest-&amp;gt;ExecuteScript (Groovy)-&amp;gt; HandleHttpResponse&lt;/P&gt;&lt;P&gt;I am able to do one logic only that either handle the json body say {"name":"Test Name","age":"25","address":"Test address"} or the file which gets sent.&lt;BR /&gt;How to process both inside my Groovy Script?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2025 11:17:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-handle-a-json-body-and-file-in-the-same-request-in/m-p/412663#M253602</guid>
      <dc:creator>AlokKumar</dc:creator>
      <dc:date>2025-10-14T11:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle a json body and file in the same request in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-handle-a-json-body-and-file-in-the-same-request-in/m-p/412665#M253604</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/114561"&gt;@AlokKumar&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for using Cloudera Community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I understand, what you need is to add one more step in your flow:&amp;nbsp;&lt;BR /&gt;HandleHttpRequest-&amp;gt; MergeContent -&amp;gt; ExecuteScript (Groovy)-&amp;gt; HandleHttpResponse&lt;/P&gt;&lt;P&gt;Since you have JSON fields and files, you're getting multiple FlowFiles.&lt;BR /&gt;So this extra MergeContent phase will combine the JSON and the file into a single FlowFile&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the MergeContent, set &lt;STRONG&gt;Merge Strategy&lt;/STRONG&gt;&amp;nbsp;as “Defragment” and set &lt;STRONG&gt;Correlation Attribute Name&lt;/STRONG&gt; as http.request.id. that is unique from each&amp;nbsp;HandleHttpRequest&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2025 18:41:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-handle-a-json-body-and-file-in-the-same-request-in/m-p/412665#M253604</guid>
      <dc:creator>vafs</dc:creator>
      <dc:date>2025-10-14T18:41:36Z</dc:date>
    </item>
  </channel>
</rss>

