SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top