http.checkURL

From ComputerCraft
Jump to: navigation, search

http.checkURL
Function
Syntax
http.checkURL()
Returns boolean true | boolean false, string error
API http
Source CC:Tweaked (source)

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

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