【问题标题】:Xcode Server Bots API: Updating a bot with PATCH requestXcode Server Bots API:使用 PATCH 请求更新机器人
【发布时间】:2018-06-20 21:38:07
【问题描述】:
我想通过 Xcode Server API 编辑我的 Xcode 机器人,方法是通过 PATCH 发送 blueprint。
但是,当我发送 PATCH 请求时,Xcode Server 会回复我旧蓝图的未更改 json。
我的请求是curl -X PATCH -H "Content-Type: application/json" -d "{\"my\": \"json\"}" https://<username>:<password>@<my_domain>:20343/api/bots/<bot_id>
我错过了什么?
【问题讨论】:
标签:
xcode
continuous-integration
httprequest
xcode-server
xcode-bots
【解决方案1】:
缺少两个参数会导致以下问题:
- 缺少
xcsclientversion:服务器将返回 400 Bad Request。
- 缺少
overwriteBlueprint=true:服务器不会更改蓝图。
您的最终请求应如下所示:
curl -X PATCH -H "Content-Type: application/json" -H "x-xcsclientversion: 18" -d "{\"json goes\": \"here\"}" https://<username>:<password>@<domain>:20343/api/bots/<_id>?overwriteBlueprint=true
来源:雷达和开发者关系(谢谢!)