C#: Invoke a Supabase Edge Function and stream the response

Invokes a Supabase Function and returns the HttpResponseMessage as soon as the response headers arrive, so the body can be read as it is produced.

Examples

Read a streamed response

using var response = await supabase.Functions.InvokeStream("stream-numbers");
using var stream = await response.Content.ReadAsStreamAsync();
using var reader = new StreamReader(stream);

while (await reader.ReadLineAsync() is { } line)
{
    Console.WriteLine(line);
}