2

这里 bintray doc 说:

Bintray REST API 需要一个应用 API 密钥。可以从用户配置文件页面获取 API 密钥。使用 HTTP >Basic Authentication 实现身份验证,用户名作为用户名,API 密钥作为 >密码。经过身份验证的 REST 调用只能通过 HTTPs 使用。

我不明白“HTTP > 基本身份验证”,如何在 linux 中做到这一点curl

4

2 回答 2

1

将参数--basic-u username:api_key 添加到 curl 命令...基本身份验证是一种未加密的方式,用于通过 HTTP 请求发送授权标头

于 2016-06-22T15:30:52.537 回答
0

例如上传文件:

curl -SvT POST \
FILE \
--user "$BINTRAY_USER:$BINTRAY_KEY" \
https://api.bintray.com/content/organization/repository/package/$version/

要在同一版本位置发布所有文件,请使用以下命令:

curl -SvX POST \
--user "$BINTRAY_USER:$BINTRAY_KEY" \
https://api.bintray.com/content/organization/repository/package/$version/publish

获取signed_url:

Linux:

curl -SvX POST \
https://api.bintray.com/signed_url/organization/repository/FILE?encrypt=false \
--user "$BINTRAY_USER:$BINTRAY_KEY" \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{"expiry": "4000000000000"}'

Win(您可以使用“k”选项跳过证书验证):

curl -SkvX POST ^
https://api.bintray.com/signed_url/organization/repository/FILE?encrypt=false ^
--user "%BINTRAY_USER%:%$BINTRAY_KEY%" ^
-H "cache-control: no-cache" ^
-H "content-type: application/json" ^
-d "{"expiry": "4000000000000"}"
于 2017-02-17T09:23:54.973 回答