NiFi通过ExecuteStreamCommand执行CURL调用SMM API时遇415不支持媒体类型错误求助
NiFi通过ExecuteStreamCommand执行CURL调用SMM API时遇415不支持媒体类型错误求助
我最近在NiFi里用ExecuteStreamCommand组件调用SMM的API时碰到了棘手的问题,每次请求都会返回415 - Unsupported Media Type错误。我怀疑是组件在发送请求前对请求体做了某种格式处理,试过转义请求体里的引号,但还是没解决问题。
下面是我的ExecuteStreamCommand组件的具体配置:
组件配置详情
- Command Arguments Strategy: Command Arguments Property
- Command Path:
curl - Ignore STDIN: false
- Argument Delimiter: 空格 (
) - Command Arguments:
-X POST -H referer:${Referer} -H 'Content-Type: application/json' -d '{"newTopics": [{"name":"testing123","numPartitions":3,"replicationFactor":3}], "allTopicNames":["testing123"]}' --negotiate -u : -b /tmp/cookiejar.txt -c /tmp/cookiejar.txt http://SMM-HOSTNAME:8585/api/v1/admin/topics
我尝试过转义请求体里的双引号,也试过不转义,但都没能解决415错误。有没有朋友遇到过类似的问题,或者能帮我分析下问题出在哪?
备注:内容来源于stack exchange,提问作者Drew Nicolette
相关产品推荐
相关产品推荐

