Download API Responses in Small Chunks
Contents
Description
Some web API responses are quite long, and it is useful to have the client download the response in small pieces or resume a download if the download is interrupted; for example, when the Internet connection is unstable.
Used With: This function is used with the WebServicesFramework in LogicNets v8.1+.
Details
LogicNets’ WebServicesFramework supports downloading a response in smaller chunks by passing the HTTP Range header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range):
In this case, the response is not written back to the client directly, but the API returns a 202 Accepted status response, Content-Range that contains the size of the actual response in bytes, Accept-Ranges, and a Location URL header you can use to retrieve the actual result.
The client can start downloading the result by calling the Location URL multiple times for each chunk.
Chunk 1
Chunk 2
Reply
Content aside
In This Article
- 1 yr agoMon, February 19, 2024 at 9:46 PM UTCLast active
- 4Views
-
1
Following