Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. local http = require "socket.http"
  2.  
  3. local data = ""
  4.  
  5. local function collect(chunk)
  6. if chunk ~= nil then
  7. data = data .. chunk
  8. end
  9. return true
  10. end
  11.  
  12. local ok, statusCode, headers, statusText = http.request {
  13. method = "GET",
  14. url = "https://en1nff4qk16pn.x.pipedream.net",
  15. sink = collect
  16. }
  17.  
  18. print("ok\t", ok);
  19. print("statusCode", statusCode)
  20. print("statusText", statusText)
  21. print("headers:")
  22. for i,v in pairs(headers) do
  23. print("\t",i, v)
  24. end
  25.  
  26. print("data", data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement