Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: web server info headers
Perhaps, even just the server name and software (Apache).
AddExtender("WWINT34I.DLL") tophandle=iBegin(0,"","") connecthandle=iHostConnect(tophandle, "www.worldwideschool.org",@HTTP,"","") datahandle=iHttpInit(connecthandle, "GET", "/", "",0) rslt=iHttpOpen(datahandle, "", 0, 0) headers=iHttpHeaders(datahandle) iClose(datahandle) iClose(connecthandle) iClose(tophandle) AskItemList("Headers were",headers,@tab,@unsorted,@single) ;parse for server. webserver=itemextract(2,headers,@tab) message("Server type:",webserver) exitor a little bit cleaner:
AddExtender("WWINT34i.DLL") tophandle=iBegin(0,"","") host="www.worldwideschool.org" ;host="www.winbatch.com" connecthandle=iHostConnect(tophandle, host, @HTTP,"","") datahandle=iHttpInit(connecthandle, "GET", "/", "",0) rslt=iHttpOpen(datahandle, "", 0, 0) headers=iHttpHeaders(datahandle) iClose(datahandle) iClose(connecthandle) iClose(tophandle) ptr=StrIndexNC(headers,"Server: ",0,@FWDSCAN) If ptr != -1 ptr2=StrIndex(headers,@TAB,ptr,@FWDSCAN) If ptr2==0 Then ptr2=StrLen(headers) ptr=ptr+StrLen("Server: ") ServerType=StrTrim(StrSub(headers,ptr,ptr2-ptr)) Else ServerType="Unknown" EndIf Message("Server Type",ServerType) Exit
Article ID: W14560Filename: Return Info on Web Server.txtFile Created: 2003:05:28:10:18:22Last Updated: 2003:05:28:10:18:22