我正在使用Octokit.net version 0.9.0
(GitHub API for .NET) 来获取少数存储库的 zip 内容。
我已经有了我需要的存储库列表,但是我无法将存储库的内容作为 .zip 文件(称为 zipball)
到目前为止我尝试过的
// ... client = new Client(...);
// some authentication logic...
// some other queries to GitHub that work correctly
var url = "https://api.github.com/repos/SomeUser/SomeRepo/zipball";
var response = await this.client.Connection.Get<byte[]>(
new Uri(url),
new Dictionary<string, string>(),
null);
var data = response.Body;
var responseData = response.HttpResponse.Body;
我的尝试有问题
data
一片空白responseData.GetType().Name
说responseData
是字符串类型- 当我尝试时,
Encoding.ASCII.GetBytes(response.HttpResponse.Body.ToString());
我得到了无效的 zip 文件
问题
使用 Octokit.net 库进行身份验证后获取存储库 zipball 的正确方法是什么?
我还在octokit.net 存储库中打开了一个问题。