How do i create a http.request event handler to not crash a program if the site is down or there is no http.
0
lua http help
Started by snoble2022, Dec 11 2012 12:19 PM
3 replies to this topic
#1
Posted 11 December 2012 - 12:19 PM
#2
Posted 11 December 2012 - 02:37 PM
if not http then print("Please enable the HTTP API in your ComputerCraft configuration file") break end
#3
Posted 31 December 2012 - 09:25 AM
Yes, I know that checks to see if http is on. But what about if http is on and someone enters a site that doesn't exist into a CC browser (Hint: im working on one), then the program crashes when trying to go there!
#4
Posted 31 December 2012 - 10:25 AM
It will return an event... http_success and http_failure..
if event == "http_failure" then print("Unable to access website.") end
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users