http.checkURL

Determine whether a URL is valid and is whitelisted, meaning the HTTP API can connect to it.

ExampleCheck whether a URL can be visited
Tests whether a remote and local URL is whitelisted
Code
<nowiki>
-- Check against a remote address
print(http.checkURL("https://example.computercraft.cc/"))
-- Check against a local address
print(http.checkURL("https://localhost"))
    </nowiki>
Output
<nowiki>
true
false Domain not permitted
</nowiki>

http.checkURL
Function
Syntax
http.checkURL(
  • url : string
)

Returns boolean true | boolean false, string error
API http
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.