Check website for error

I need to check a website for error, I do not need to display it.
I tried creating a TCPSocket for checking it:

While Not TCPSocket1.IsConnected //check to see if the socket got an error If TCPSocket1.LastErrorCode <> 0 then TCPSocket1.Close return "Socket error: "+str(TCPSocket1.LastErrorCode) Exit End If //poll the socket to let it do its thing TCPSocket1.Poll Wend

But when the site is showing error 503, for example, it still does not return any error code.
Any ideas ?? Thanks

Perhaps try an HTTPSocket rather than a TCPSocket?

You are definitely right… thanks
I just found difficult to get Error code from HHTPSocket when running synchronously.