Advertisement
DOGGYWOOF

Untitled

Sep 7th, 2024
6
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. -- Enable the HTTP API
  2. os.loadAPI("http")
  3.  
  4. -- Define the URL
  5. local url = "http://www.monas-cakes.co.uk"
  6.  
  7. -- Make the HTTP GET request
  8. local response, status = http.get(url)
  9.  
  10. -- Check for errors
  11. if not response then
  12. print("Error: " .. status)
  13. return
  14. end
  15.  
  16. -- Print the response body
  17. print(response.readAll())
  18.  
  19. -- Close the response
  20. response.close()
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement