Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to process "streaming response" or "chunked response" data from a streaming REST API endpoint with Blazor server-side using .NET 6.x?

$
0
0

With my Blazor application, I am hitting a REST API endpoint that produces both streaming and non-streaming results, depending on the endpoint I hit. The non-streaming endpoint is just standard JSON:

{"key":"value",    ...}

Which I have no problem processing to the Blazor front-end.

However, the streaming is not standard JSON, and looks like this:

data: {"key":"value",    ..."data_complete_token":false}data: {"key":"value",    ..."data_complete_token":false}data: {"key":"value",    ..."data_complete_token":false}...data: {"last_key":"last_value",    ..."data_complete_token":true}

After many Google searches, I believe the data coming from the streaming endpont is called a "streaming response" or "chunked response".

I have done some Google searches using these parameters:

how to read data from rest api streaming response with blazor server -WebAssembly

And I seem to still get results for WebAssembly and not many for server-side. Those that are for server-side don't seem to be what I am looking for.


EDIT:

To clarify what I am doing, I am hitting a Mixtral LLM endpoint which "streams" it's responses one word at a time.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>