brightscript - Download contents of POST request to file -
I'm working on a Roku app which displays MJPEG video It's a bit tricky as far as I I can tell that there is no way to handle generic streams on HTTP in BrightScript. What I have done is starting a download with roUrlTransfer.GetToFile. Then I can process the TMP file which MJPEG is constantly downloading. I have to clean the file and have to move in some time to avoid relocating, but it works well enough.
The problem I have is that I need to support the source which requires that I post the information of a few sessions to display the MJPEG below. As far as I can tell, roUrlTransfer does not provide a way of posting a string and saves the result as a file. Is there a way to accomplish that I am not seeing?
I'm doing a good job for this problem. GET Parameter to query string) and to overwrite the request method on POST . You can then use GetToString () to return the requested data. See the examples given below:
conn = CreateObject ("roUrlTransfer") url = "http://somedomain.com/endpoint?param1=foo¶m2=bar" conn.SetUrl (url ) Conn. Do not forget to overwrite the SETRequest ("POST") http method data = conn.gettostring ()
edit: I realized that my response was not Answer your question anyway, I do not want to delete it because it can be the answer for other people.
Comments
Post a Comment