Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
#Include "httprequest.inc"
Function PBMain () As Long
? Str$( URLExists("http://www.garybeene.com/index.htm") )
End Function
Function URLExists(URLTest As WStringZ * %Max_Path) As Long
Local Buffer$, Domain$, iPos As Long
Domain$ = LCase$(URLTest)
Replace "http://" With "" In Domain$
iPos = InStr(Domain$,"/")
If iPos Then Domain$ = Left$(Domain$,iPos-1)
Tcp Open "HTTP" At Domain$ As #1 TimeOut 60000
Tcp Print #1, "HEAD " + URLTest + " HTTP/1.0"
Tcp Print #1, ""
Tcp Recv #1, 4096, Buffer$
Tcp Close #1
If InStr( Parse$(Buffer$,$CrLf,1), "OK") Then Function = 1
End Function
'gbs_01303
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm