init_test.lua 551 B

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