Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jiadai777
Reel Rookie

Brightscript Task GET Request Taking Long Time

Hi, I'm a new developer in the Roku community. I'm developing a program which will first load data from a url and parse it to JSON: https://eloquent-murdock-abe484.netlify.app/feed.txt

On our other devices, such as web app, iOS, and android, or even use curl to download, it takes about 4 seconds or faster to just get response and parse the data. But on brightscript, it takes about 12 seconds. This is the brightscript API I'm using:

request = CreateObject("roUrlTransfer")
request.InitClientCertificates()
request.SetCertificatesFile("common:/certs/ca-bundle.crt")
port = CreateObject("roMessagePort")
request.SetMessagePort(port)

request.SetUrl("https://eloquent-murdock-abe484.netlify.app/feed.txt")

response = request.GetToString()
m.global.addFields({feed: ParseJson(response)})
date = CreateObject("roDateTime")
print "feed parse finished: "; date.AsSeconds()

Is this the only API available for doing what I tried to do, or is there a faster way? Any comments or advice would help. Thanks!

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.