我有兴趣用非.NET语言编写NuGet v3 API的客户端库。
获取软件包所需的请求是什么,响应看起来如何?
例如:
GET {package-versions} GET {package-version}
请同时提供覆盖此场景的官方文档链接。
我有兴趣用非.NET语言编写NuGet v3 API的客户端库。
获取软件包所需的请求是什么,响应看起来如何?
例如:
GET {package-versions} GET {package-version}
请同时提供覆盖此场景的官方文档链接。
这里是官方的NuGet V3 API文档。API由多个协议组成,包括:
nuspec
)的存储库。例如,假设您想要下载“Newtonsoft.Json”软件包:
响应包含PackageBaseAddress(也称为扁平容器,但实际上是分层的而不是扁平的 :))的地址:
{
"@id": "https://api.nuget.org/v3-flatcontainer/",
"@type": "PackageBaseAddress/3.0.0",
"comment": "Base URL of Azure storage where NuGet package registration info for DNX is stored, in the format https://api.nuget.org/v3-flatcontainer/{id-lower}/{version-lower}.{version-lower}.nupkg"
},
GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json
,请注意这个uri可能会变化,且不是API的一部分。GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/6.0.4/newtonsoft.json.6.0.4.nupkg
您还可以查看NuGet客户端。客户端的源代码在这里;您需要从NuGet.CommandLine项目开始,并逐步向下深入。