Hi Roy,
Here is some code that you can use as the basis of a function to check a URL. I've just added some comments where you would tailor it to your specific needs, depending on whether you just need a function with an Exists/Not Exists/Error status, or something more complex.
It uses a HEAD http request which is basically a GET request that doesn't return the content. Most servers should support it, but if not it can be replaced with a GET request. The GET request will return the file contents, so it will be slower than a HEAD request.
integer li_response = -1
integer li_rc
string ls_content_length
string ls_url
// this should be the argument to the function
ls_url = 'www.google.de/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png'
// The url needs to begin with http or httpd, so add it if it doesn't
if Lower(Left(ls_url, 4)) <> 'http' then ls_url = 'https://' + ls_url
HttpClient lo_httpclient
lo_httpclient = Create HttpClient
// If the server doesn't support HEAD, you can use GET, but then the whole file is downloaded
li_rc = lo_httpclient.SendRequest('HEAD', ls_url)
if li_rc = 1 then
li_response = lo_httpclient.GetResponseStatusCode()
choose case li_response
case 200
// Found. Can set a status or do something else here if required
// You can get the content length if you need to see how big the file is
ls_content_length = lo_httpclient.GetResponseHeader('content-length')
case 404
// Not Found. Can set a status or do something else here if required
case else
// Some Other Error. Can set a status or do something else here if required
end choose
else
// An error with the request (e.g. invalid server).
// Can set a status or do something else here if required
// MessageBox('Error Checking', 'Error calling ' + ls_URL + '~r~nReturn Code ' + string(li_rc))
end if
destroy lo_httpclient
return li_response