Way to receive web request response as a stream

The SubMusic app connects to subsonic music servers to sync music to the watch. One of the requests that need to be sent to the server is to get the list of songs inside a playlist. Unfortunately this api doesn't allow pagination. 

This very quickly runs into the error 402 as the response is too large.

Is there a way to work on a response in a streaming way? Character/byte stream would be enough, it's clear that there wouldn't be an automatic conversion of the json to the data structure.

  • I do not believe there is. This is one of the flaws is that if the server sends too much data, there is no way to restrict this on the watch. The only way would be for you to use a proxy which strips out data you do not need (if this cannot be controlled using parameters on the original api) or implementing your own pagination. It would be good if you could specify some kind of pagination from the watch itself to discard extra data but this does not exist today.

  • I think unfortunately none of the options are possible in this case, the app is there to basically allow anyone to access their own subsonic based api.

    So people will not want to go through a proxy (which could in theory read out their credentials). 

    Also the api is pretty fixed as various different servers implement the api and it's unfortunately not so nice.

  • Could you write a companion app that makes the requests and does the pagination on the phone and then sends the results to the device?