terraform - Terraform 提供者 restapi:我如何忽略阅读响应
问题描述
我正在对不返回任何响应正文的 api 执行 PUT/POST。在这种情况下,terraform 总是会抛出以下错误,因为响应正文是空的。
我正在使用terraform-provider-restapi对slack进行 PUT/POST 调用。这是我的提供商配置。
provider "restapi" {
update_method = "PUT"
id_attribute = "username"
write_returns_object = false
uri = "https://hooks.slack.com/services"
headers = {
"Accept" = "text/plain"
"Content-Type" = "application/json"
}
}
由于 slack rest 调用不返回任何内容,并且terraform-provider-restapi正在尝试读取响应,最终引发以下错误。
unexpected end of JSON input
我想忽略阅读terraform-provider-restapi的响应。有什么选择吗?
解决方案
推荐阅读
- r - 如何使用 R 中的 inner_join、dplyr 将两个数据帧连接到 2 列,这些列应该同时匹配?
- postgresql - 我应该在固定长度的 bytea PK 列上设置 STORAGE PLAIN 吗?
- node.js - MongoDB如何限制每个组/类别/条件的结果?
- python - 验证熊猫中的水平行数据
- r - 如何克服 NextMethod(.Generic) 中的错误:无法将“tsp”分配给零长度向量
- python - 在使用 for 循环时编写 Excel 文件
- javascript - 在 React 应用程序中通过 Axios 处理多个 API
- react-native - Expo (React-native) - 适用于托管工作流程的 AdMob 替代方案
- java - 动态管理在 Wildfly 上部署和爆炸的 EAR
- opencv-python - 删除opencv中未连接的小斑点