GitHub Rest API转让所有权

时间:2018-02-15 13:08:35

标签: git rest powershell github

我正在尝试使用PowerShell转移存储库的所有权。

这就是我的JSON:

$owner ='x'
$project ='test'

$transfer = '{
  "new_owner": "xyz"
}' 

我使用POST:

Invoke-WebRequest "http://git.bfl.local/api/v3/repos/$owner/$project/transfer" -Headers $Headers -Method POST -Body $transfer 

我收到此错误:

Invoke-WebRequest : {"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.9/v3"}

我遵循了这个指南:https://developer.github.com/v3/repos/#transfer-a-repository

$Token ='istuc:xxx'
$Based64Token = [System.Convert]::ToBase64String([char[]]$Token);

$headers = @{
    "Authorization" = 'Basic {0}' -f $Based64Token;
    "Accept" = "application/vnd.github.nightshade-preview+json";
    "Content-Type" = "application/json";
}

0 个答案:

没有答案