json - 如何在一行上使用 CURL 传递数据
问题描述
您好,我想使用 API 方法通过 curl 显示 jenkins 构建状态,如下所述:https ://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/
组装:
curl -u username:'password' -H "Content-Type: application/json" -X POST https://tools.my.repo.com/bitbucket/rest/build-status/1.0/commits/620d293ed88412e45c58aae537b8765be2e8d148 -d @build0.json`
我的构建 json 包含:
{
"state": "SUCCESSFUL",
"key": "8",
"name": "feature/branch",
"url": "https://my.jenkins.placeholder/job/Plugintest/",
"description": "Changes by Umbert Eco"
}
我需要把它放在一条线上……有可能吗?
解决方案
是的!!尝试以这种方式构建卷曲
curl -u username:password -H "Content-Type: application/json" -X POST https://tools.my.repo.com/bitbucket/rest/build-status/1.0/commits/620d293ed88412e45c58aae537b8765be2e8d148 -d '{\"state\": \"SUCCESSFUL\",\"key\": \"8\",\"name\": \"feature/branch\",\"url\": \"https://my.jenkins.placeholder/job/Plugintest\",\"description\": \"Changes by Umbert Eco\"}'
推荐阅读
- aws-lambda - 基于 cookie 的两个源之间的 Lambda@Edge 路由
- php - 如何在 WordPress 中的作者存档页面下列出帖子?
- c# - RestSharp - 您的浏览器当前设置为阻止 cookie
- c# - 为什么在调用 lambda 表达式中的委托函数时保留参数 i?
- maven - 由于缺少执行数据文件,在具有模块且没有单元测试的项目中跳过 JaCoCo 执行
- vue.js - 如何在 Vue Loader 中使用 compose 和非 CSS 文件
- jquery - Jquery移动元素丢失了那个元素
- ios - 删除行时的 EXC_BAD_ACCESS(代码=EXC_I386_GPFLT)(在:[IndexPath])
- javascript - 我现在如何将 firebase.database.ServerValue.TIMESTAMP 转换为其相应的日期或时间?
- c# - 我在日期过滤器中从早上 5.30 获取记录,在时区发出