You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 14:23:09