9
instructions hereを使用してコマンドラインからOAuthトークンを作成しようとしています。私は、コマンドラインからcurl
を使用して、今すぐRCurl/httrをGithub基本認証に使用する
curl -u 'username:pwd' -d '{"scopes":["user", "gist"]}' \
https://api.github.com/authorizations
正しい応答を取得することができています、私はRCurl
またはhttr
を使用してRに同じを複製します。ここで私が試したものですが、両方のコマンドがエラーを返します。誰でも私がここで間違っていることを指摘できますか?
httr::POST(
'https://api.github.com/authorizations',
authenticate('username', 'pwd'),
body = list(scopes = list("user", "gist"))
)
RCurl::postForm(
uri = 'https://api.github.com/authorizations',
.opts = list(
postFields = '{"scopes": ["user", "gist"]}',
userpwd = 'username:pwd'
)
)
、httpauth = 1L' –
、 – hadley
上と' authenticate'に起こっているのを正確にものを見るために冗長フラグを使用してみてください設定 'タイプ=「基本」' – hadley