· Sep 23, 2022

HTTP request hanging

Hi Guys,

I'm able make a request through the browser with no issues as below:


so I created this code to do the same but, when running the method from terminal the process just hangs and not doing anything not sure why? 


ClassMethod GetTempFromAC()

Set Httprequest=##class(%Net.HttpRequest).%New()
//Set Httprequest.SSLConfiguration="RTLS"
Set Httprequest.Server=""
Set Httprequest.Timeout=30
    //Set Httprequest.Port=9981
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)




Product version: Caché 2014.1
Discussion (1)1
Log in or sign up to continue

Does it work with something like Postman? I'd probably look at it with something like JOBEXAM to see what line of code it is executing. Maybe there is something specific browser based that it is passing that you have to define explicitly in the HTTP request.  Also suggest to try in a later Cache or IRIS version.
If you need help debugging feel free to open a WRC case with us.