From 0c0c11b2783fd8cfa0a3fadae8419f61c3bf118f Mon Sep 17 00:00:00 2001 From: qwsdcvghyu89 <61093706+qwsdcvghyu89@users.noreply.github.com> Date: Fri, 3 Apr 2026 12:01:46 +1100 Subject: [PATCH] fix: use ResponseHeadersRead for streaming-friendly HTTP responses --- Beam.Api/ApiCall.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Beam.Api/ApiCall.cs b/Beam.Api/ApiCall.cs index d559725..547348a 100644 --- a/Beam.Api/ApiCall.cs +++ b/Beam.Api/ApiCall.cs @@ -35,8 +35,9 @@ namespace Beam.Api; foreach (var header in Headers) request.Headers.Add(header.Key, header.Value); + logger?.LogInformation("Fetching '{}' with method '{}', content-type '{}', and headers '{}'", Uri, Method, ContentType, JsonSerializer.Serialize(request.Headers.ToDictionary())); - var response = await Client.SendAsync(request, ct); + var response = await Client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, ct); if (tries is not null && tries?.@try < tries?.max && !SuccessCodes.Contains(response.StatusCode)) { await Task.Delay((int)Math.Min(Math.Pow(2, tries.Value.@try), 60) * 1000, ct);