如何使用 HTTP API 请求开始构建 Travis CI 项目

How to start build Travis CI project with HTTP API request

我已经在 GitHub 上上传了一个非常 simple Maven Project 用 Java 编写的包括 .yml 文件以集成 Travis CI。 该项目可通过 travis-ci 平台上的相应按钮 "Restart Build" 手动构建,但我想使用 API 请求开始构建,如本 link 中所述: https://developer.travis-ci.com/resource/build#Build.

我正在使用 RestClient Firefox 插件,但这些命令不起作用。

与您使用的 http 客户端无关。 您可以访问 travis v3 API.

请求来自 Travis 的示例 API v3 文档 [link]

body='{
   "request": {
   "branch":"master"
}}'

curl -s -X POST \
   -H "Content-Type: application/json" \
   -H "Accept: application/json" \
   -H "Travis-API-Version: 3" \
   -H "Authorization: token xxxxxx" \
   -d "$body" \
https://api.travis-ci.org/repo/...