Http failure (event)
From ComputerCraft Wiki
This page needs some serious TLC, stat! Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: A demonstration on the use and handling of this event would be beneficial. AfterLifeLochie 15:53, 30 November 2012 (MSK)) |
Event http_failure | |
Fired when a call to http.request(), http.get() or http.post() fails. | |
Returned Object 1 | The URL to the website. |
Example | |
Prints a message and quits when the requested URL could not be contacted. | |
Code |
http.request( "http://www.example-failure.com" ) while true do event, url = os.pullEvent() if event == "http_failure" then print( "Cannot contact the server: "..url ) break end end |