curl - 使用 ExecuteProcess 和 --data-binary 标记的 Curl 函数在 Apache Nifi 中不起作用
问题描述
我在将 ExecuteProcess 与使用--data-binary
标签的 curl 命令一起使用时遇到问题。当我在终端中运行此命令时,它可以工作:
curl https://api.webflow.com/collections/5f7146cacb2fc106ad4c0386/items/ \
-H "Authorization: Bearer bce8078f0495fc47a5e9d2534f25e1335d0aa316601c2fc9971b169f1aeadc17" \
-H "accept-version: 1.0.0" \
-H "Content-Type: application/json" \
--data-binary $'{
"fields": {
"name": "Exciting blog post title",
"slug": "exciting-post",
"_archived": false,
"_draft": false
}
}'
但是,当我在 NiFi 中将其作为 ExeccuteProcess 运行时,它会返回以下错误:
{
"msg": "Invalid request body",
"code": 400,
"name": "ValidationError",
"path": "/collections/5f7146cacb2fc106ad4c0386/items",
"err": "ValidationError: Invalid request body"
}
这是指向 createItem curl 命令的 WebFlow 文档的链接: https ://developers.webflow.com/#create-new-collection-item
有人可以给我的任何帮助都会很棒。如果我应该使用另一个处理器来发出这些类型的请求,那就太棒了。
解决方案
这里的简单解决方案是将其包装在 shell 脚本(或 Windows 上的 PowerShell/BAT 文件)中并调用该脚本。
推荐阅读
- ssas - SQL Server 分析服务在维度字符串属性中传递空值和空白值
- office365 - 如何以编程方式获取标签活动报告(O365 数据治理)用户级别和文件级别?
- asp.net-core-2.1 - TryApplyChanges 没有得到更新的实际解决方案 Buildalyzer adhocworkspace
- python - 如何将多个不同维度的分类输入变量用于随机森林回归模型?
- docker - denied:请求的资源访问被拒绝
- javascript - 对地址进行地理编码时,标记未显示在地图中
- ecmascript-6 - 为什么在特定情况下需要 ES6 解构?
- c# - 如何停止 Wndproc() 循环?
- ruby-on-rails - 如何在 Rails 服务器控制台中获取 postgressql 数据库本机数据类型
- javascript - 表单提交javascript html中的触发操作