postapache-nifi

Add header to PostHttp processsor Apache Nifi


I'm trying to add a custom header in my post request header in Apache NiFi, I have seen that in the configuration tab, there are attributes to send as HTTP header (regex) I'm not very familiar with regex, any idea how to add a header and its value like the following: token: READ?


Solution

  • PostHttp's "Attributes to Send as HTTP Headers (Regex)" property can accept a regex, but it will work just fine to specify a single attribute name like token. If you had multiple attribute you wanted to name, you could use a pipe to "or" them together:

    token|attrib2|attrib3
    

    For each attribute you selected, the attribute name and value are sent as the HTTP header name and value.