Jam*_* Ko 13 .net c# nuget nuget-package nuget-server
我有兴趣用非.NET语言编写围绕NuGet v3 API的客户端库.我在哪里可以找到关于它的文档/资源,告诉我例如哪些URL提出请求以及它将返回什么响应?
我尝试过快速谷歌搜索,但唯一出现的是这个,这是3年前的最后一次更新.是否存在规范?
Yis*_*zer 19
这是官方的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"
},
Run Code Online (Sandbox Code Playgroud)
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项目开始,然后沿着堆栈走下去.