HTTP request with open stream
Hi Guys,
This link (https://github.com/CassiaNetworks/CassiaSDKGuide/blob/master/node_exampl...) uses Javascript request to open a a steam and collect data in an array (screenshot below) and I'm trying to replicate this with Cache script with HTTP request which is connecting Ok but don't know how can I collect data because the code is hanging at Set tSc=Httprequest.Get(HttpURL) and cannot execute S BLEConnect=Httprequest.HttpResponse.StatusLine or any line after it.
I think the url call (ac1.mqtt.sx3ac.com/api/gap/nodes?&mac=CC:1B:E0:E1:A6:44&access_token=8f7f44d842cbcadd53713cca2ea36f256b2ec6581658fee4e246d93e28c6feb3&active=1&event=1
) should do that by keeping an open stream because if I run the same url through the browser or Postman it does the same, but how can I get the data the same way this JavaScript code is doing?
Set Httprequest=##class(%Net.HttpRequest).%New()
Set Httprequest.Server="ac1.mqtt.sx3ac.com"
Set Httprequest.Timeout=30
Set Httprequest.Https=0
set Httprequest.ContentType="application/json"
Do Httprequest.SetHeader("Accept","application/json")
Do Httprequest.SetHeader("Accept-Language","en_US")
Do Httprequest.SetHeader("Authorization","Bearer "_Token)
Set HttpURL="/api/gap/nodes?filter_rssi=-75&chip=1&mac=CC:1B:E0:E2:3C:10&active=1&event=1"
Set tSc=Httprequest.Get(HttpURL)
S BLEConnect=Httprequest.HttpResponse.StatusLine
Thanks