sendYo.lua 582 B

12345678910111213141516
  1. --This code assumes that the WIFI AP has already been set up
  2. print("sending hardcoded yo")
  3. sk = nil
  4. sk = net.createConnection(net.TCP,0)
  5. sk:on("receive", function(sck, c) print(c) end )
  6. sk:on("connection", function(sk, payload)
  7. sk:send("POST /yo/ HTTP/1.1\r\n"
  8. .."Host: api.justyo.co\r\n"
  9. .."Connection: close\r\n"
  10. .."Content-Length: 63\r\n"
  11. .."Accept: */*\r\n"
  12. .."Content-type: application/x-www-form-urlencoded\r\n\r\n"
  13. .."api_token=99c680b7-5f9f-48fd-9459-46cda7e1c8fa&username=EPUKAZA")
  14. end)
  15. sk:connect(80, "api.justyo.co")