roku - How do you get error code from syncronous roUrlTransfer call -


i have piece of code gets , parses json https url:

function getjson(surl string) dynamic     if surl = invalid return invalid     httpget = createobject("rourltransfer")     httpget.seturl(surl)     httpget.enableencodings(true)     httpget.retainbodyonerror(true)     sdata = httpget.gettostring()     if sdata = ""          print "error: " + surl + " : " + httpget.getfailurereason()     end if      data = parsejson(sdata)     return data end function 

sdata empty. how http response code or error? httpget.getfailurereason() blank...

turns out fix add this, need find out how dump the http(s) error know going on

    httpget.setcertificatesfile("common:/certs/ca-bundle.crt")     httpget.initclientcertificates() 

any idea?

check documentation gettostring. can't response code synchronous call. use asyncgettostring instead.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -