title: GitHub Rest API transfer ownership
body: <p>I am trying to transfer ownership for a repository using PowerShell.</p>
  
  <p>This is how it looks my JSON:</p>
  
  <pre><code>$owner ='x'
  $project ='test'
  
  $transfer = '{
    "new_owner": "xyz"
  }' 
  </code></pre>
  
  <p>I POST using :</p>
  
  <pre><code>Invoke-WebRequest "http://git.bfl.local/api/v3/repos/$owner/$project/transfer" -Headers $Headers -Method POST -Body $transfer 
  </code></pre>
  
  <p>I get this error: </p>
  
  <pre><code>Invoke-WebRequest : {"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.9/v3"}
  </code></pre>
  
  <p>I followed this guide: <a href="https://developer.github.com/v3/repos/#transfer-a-repository" rel="nofollow noreferrer">https://developer.github.com/v3/repos/#transfer-a-repository</a></p>
  
  <pre><code>$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";
  }
  </code></pre>