我正在尝试如下:
SSHKEY=`cat ~/.ssh/id_rsa.pub`
curl -u username:password -X POST -H "Content-Type: application/json" -d '{"key": "$SSHKEY", "label": "someLabel"}' https://api.bitbucket.org/2.0/users/username/ssh-keys
但它给出了:
{"type": "error", "error": {"fields": {"key": ["That SSH key is invalid."]}, "message": "key: That SSH key is invalid."}}
关于如何使用 api 将此 ssh 密钥发送到 bitbucket 的任何想法?