fireandlight27
11 years agoVisitor
Download contents of POST request to file
I'm working on a Roku app that displays MJPEG videos. This is a little bit tricky because as far as I can tell there isn't really a way to handle a generic stream over HTTP in Brightscript. What I've done that works is initiate a download with roUrlTransfer.AsyncGetToFile. I can then process the tmp file that is created as the MJPEG is continuously downloaded. I have to clean up the file and restart the transfer every once in awhile to avoid overflowing the storage space, but it works well enough.
The problem I'm having is that one of the sources I need to support requires that I POST some session information in order to pull down the MJPEG I need to display. As far as I can tell roUrlTransfer doesn't provide a way to POST a string and save the result as a file. Is there a way to accomplish this that I'm not seeing? Even better, is there a way to process an HTTP response as it comes instead of all-at-once when it completes?
* Edited to reflect that I'm currently using AsyncGetToFile not GetToFile
The problem I'm having is that one of the sources I need to support requires that I POST some session information in order to pull down the MJPEG I need to display. As far as I can tell roUrlTransfer doesn't provide a way to POST a string and save the result as a file. Is there a way to accomplish this that I'm not seeing? Even better, is there a way to process an HTTP response as it comes instead of all-at-once when it completes?
* Edited to reflect that I'm currently using AsyncGetToFile not GetToFile