Your hack worked. I probably had a typo error when I tried GetResponseHeader(). I attached the header list for the Idera url. I checked with the person I will be compiling this for and he is only interested in the set-cookie header. That was easy to test with both the Idera url and WB tech db url. I can adapt the code to a UDF chkheader(url,header). Didn't mean to come off so contentious in my replies. My hack to your hack can test for Set-Cookie
;CLR - attempt Web Request to get headers only
hdr = 'Set-Cookie'
;comment/uncomment url to test
Url = 'https://community.idera.com/' ;header should exist
;Url = 'https://techsupt.winbatch.com/' ;header should not exist
;==============================================================
ObjectClrOption('useany', 'System')
oWebUtil = ObjectClrNew('System.Net.WebUtility')
oUri = ObjectClrNew('System.Uri', Url)
oSvcManager = ObjectClrNew('System.Net.ServicePointManager')
protocols = ObjectClrType("System.Net.SecurityProtocolType",3072|768)
oSvcManager.SecurityProtocol = protocols
oSvcPoint = oSvcManager.FindServicePoint(oUri)
oWebRequest = ObjectClrNew('System.Net.WebRequest')
oRequest = oWebRequest.Create(Url)
oRequest.Timeout = oRequest.Timeout * 6
objResponse = oRequest.GetResponse()
if objResponse.SupportsHeaders
header = objResponse.GetResponseHeader(hdr)
if Strlen(header)==0
message('Set-Cookie Header', "Does Not Exist")
else
message(hdr:' Header', header)
endif
else
Message('Are Headers supported','Headers not supported')
endif
objResponse.Close()
Exit