json - 对 ansible playbook 的 curl 请求
问题描述
示例 curl 请求。
curl -X POST \
--data '"test connection"' \
-H 'Content-type: application/json' \
-H 'Authorization: Basic asdfasdf' \
dns.com/end
现在,我想使用 curl ansible playbook 发送完全相同的消息。
---
- name: "Send test"
hosts: localhost
tasks:
- name: Send test
uri:
url: dns.com/end
method: POST
src: '"test connection"'
body_format: json
headers:
Content-type: "application/json"
Authorization: "Basic asdfasdf"
我收到一个错误。
解决方案
推荐阅读
- c# - 从 AvalonDock LayoutAnchorable 中移除停靠组合按钮
- vue.js - 从 Capacitor 配置文件中获取 appId
- mule - 为组件中的参数“资源”找到无效配置
- c++ - Visual Studio Code - 更改编译器会出错
- wordpress - 使用 url 重写规则防止管理目录重定向
- actions-on-google - @assistant/conversation 中 CollectionBrowse 中的循环语句有什么用?
- terraform - Terraform:模块输出
- flutter - 无论如何在颤动的文本表单字段上创建可忽略的工具提示
- javascript - 打字稿展平地图数组
- jmeter - Jmeter中的文件上传问题