public static async Task GetNupkgContentAsync()

in JetBrains.Profiler.SelfApi/src/Impl/NuGet.cs [173:196]


      public static async Task<HttpContent> GetNupkgContentAsync(
        HttpClient http,
        Uri nugetUrl,
        string packageId,
        SemanticVersion packageVersion,
        CancellationToken cancellationToken)
      {
        var indexUrl = nugetUrl.Combine("FindPackagesById()").Query($"id='{packageId}'");
        var feed = await GetFeedAsync(http, indexUrl, cancellationToken).ConfigureAwait(false);

        var latestEntry = GetLatestEntry(feed, packageVersion);
        var packageUrl = latestEntry.ContentSrc;

        Trace.Info("NuGet.V2.GetNupkgContent: {0}", packageUrl);
        var response = await http
          .GetAsync(packageUrl, HttpCompletionOption.ResponseHeadersRead, cancellationToken)
          .ConfigureAwait(false);

        response.EnsureSuccessStatusCode();

        response.Content.Headers.Add("Version", latestEntry.Version.ToString());

        return response.Content;
      }