webrequest
I don't believe you can. All you can do is check if the Webrequest function fails and if so, alert the user to check that the URL is listed.
Yes, you could use WinAPI, but only if DLL calls are enabled. If this is for a Market Product or for MQL5 VPS, then DLL is not enable or allowed.
But for other situations, if it is the case that DLL calls are enabled and allowed, then you might as well use WinAPI directly for the web communications.