Use NuGet autocomplete API for add-package suggestions (#9171)
This commit is contained in:
parent
f63839ddd6
commit
6c9942bae6
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(10));
|
var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(10));
|
||||||
var response = httpClient.GetAsync($"https://api-v2v3search-0.nuget.org/query?q={match}&skip=0&take=100&prerelease=true", cancellation.Token)
|
var response = httpClient.GetAsync($"https://api-v2v3search-0.nuget.org/autocomplete?q={match}&skip=0&take=100", cancellation.Token)
|
||||||
.Result;
|
.Result;
|
||||||
|
|
||||||
result = response.Content.ReadAsStreamAsync().Result;
|
result = response.Content.ReadAsStreamAsync().Result;
|
||||||
|
@ -77,7 +77,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
|
|
||||||
foreach (var id in json["data"])
|
foreach (var id in json["data"])
|
||||||
{
|
{
|
||||||
yield return id["id"].Value<string>();
|
yield return id.Value<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue