Advertisement
Ov0sh

Test

Jan 23rd, 2022 (edited)
1,152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. -- https://github.com/kikito/inspect.lua/blob/master/inspect.lua
  2. local internet = require("internet")
  3.  
  4. local handle = internet.request("http://comp.naruto-calc.cf/test")
  5. local result = ""
  6. for chunk in handle do result = result..chunk end
  7. -- Print the body of the HTTP response
  8. -- print(result)
  9.  
  10. -- Grab the metatable for the handle. This contains the
  11. -- internal HTTPRequest object.
  12. local mt = getmetatable(handle)
  13.  
  14. -- The response method grabs the information for
  15. -- the HTTP response code, the response message, and the
  16. -- response headers.
  17. local code, message, headers = mt.__index.response()
  18. print("code = "..tostring(code))
  19. print("message = "..tostring(message))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement