http_failure event
Fired when a request created with http.request fails.
|
|||
Requests the example 404 page and prints the result. | |||
Code | <nowiki>
-- Request the example page
http.request("https://example.computercraft.cc/404")
while true do
-- Wait for a http_failure event.
local event, url, handle = os.pullEvent("http_failure")
-- If it's for our URL, then print the result.
if url == "https://example.computercraft.cc/404" then
print(reason, handle and handle.readAll() or "")
if handle then handle.close() end
end
end
</nowiki>
|
http_failure Event | |
---|---|
Returns
| |
Source | CC:Tweaked |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.