in JetBrains.Profiler.SelfApi/src/Impl/NuGet.cs [338:355]
private static async Task<ServiceIndex> GetIndexAsync(
HttpClient http,
Uri indexUrl,
CancellationToken cancellationToken)
{
Trace.Info("NuGet.V3.GetIndex: {0}", indexUrl);
using (var response = await http
.GetAsync(indexUrl, HttpCompletionOption.ResponseHeadersRead, cancellationToken)
.ConfigureAwait(false))
{
response.EnsureSuccessStatusCode();
using (var indexJson = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
{
return (ServiceIndex) new DataContractJsonSerializer(typeof(ServiceIndex))
.ReadObject(indexJson);
}
}
}