将标头添加到 PostHttp 处理器或 Apache Nifi [英] Add header to PostHttp processsor Apache Nifi
问题描述
我试图在我的 apache nifi 中的 post 请求标头中添加一个自定义标头,我已经看到在配置选项卡中有要作为 http 标头发送的属性(正则表达式)我对正则表达式不是很熟悉,不知道如何添加标题及其值,如下所示:token : READ ?
Im trying to add a custom header in my post request header in apache nifi, I have seen that in the configuration tab there's 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 ?
推荐答案
PostHttp 的作为 HTTP 标头发送的属性(正则表达式)"属性可以接受正则表达式,但它可以很好地指定单个属性名称,例如令牌
.如果您有多个要命名的属性,则可以使用管道将它们或"在一起:
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
对于您选择的每个属性,属性名称和值将作为 HTTP 标头名称和值发送.
For each attribute you selected, the attribute name and value are sent as the HTTP header name and value.
这篇关于将标头添加到 PostHttp 处理器或 Apache Nifi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!