Invalid Return
BRIGHTSCRIPT: ERROR: ParseJSON: Data is empty:
In the basic navigation project if you brought me information, so I coded it and if it returns me:
port = CreateObject("roMessagePort")
request = CreateObject("roUrlTransfer")
request.AddHeader("Authorization", "Basic <BASE 64 ENCODED SEGMENT WRITE KEY>")
request.AddHeader("Accept", "application/json")
request.AddHeader("Content-Type", "application/json")
request.EnablePeerVerification(false)
request.EnableHostVerification(false)
request.RetainBodyOnError(true)
request.SetCertificatesFile("common:/certs/ca-bundle.crt")
request.InitClientCertificates()
request.SetMessagePort(port)
request.SetUrl("https://.../metadata/x?limit=1")
if (request.AsyncGetToString())
while (true)
msg = wait(0, port)
if (type(msg) = "roUrlEvent")
code = msg.GetResponseCode()
if (code = 200)
playlist = CreateObject("roArray", 10, true)
json = ParseJSON(msg.GetString())
'print json
for each kind in json.editorials
-------------------------
But when placing it in scene graph something I do wrong, taking into account that it is HTTPS I do the following:
m.readerTask = createObject("roSGNode", "ContentReader")
m.readerTask.setField("uri", "https://.../metadata/x?limit=1")
m.readerTask.observeField("content", "buildModel")
m.readerTask.control = "RUN"
I call the component that extends of task and I put the following:
content = createObject("roSGNode", "ContentNode")
contentxml = createObject("roXMLElement")
readInternet = createObject("roUrlTransfer")
readInternet.setUrl(m.top.uri)
result = readInternet.getToString()
json = ParseJSON(result)
for each kind in json.editorials
There the error described appears to me, is there any other way to do it or that advises me to correct