我的 GET 请求有问题。带有 NodeMCU 的 ESP8266。我在 Arduino 中的代码:
String cmd = "conn:send(\"GET /json.htm?type=command¶m=udevice&idx=2&nvalue=0&svalue=11 HTTP/1.1\r\nHost: 192.168.0.101\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n\")";
wifi.println("conn=nil");
wifi.println("conn=net.createConnection(net.TCP, 0)");
wifi.println("conn:on(\"receive\", function(conn, payload) print(payload) end)");
wifi.println("conn:connect(8080, \"192.168.0.101\")");
wifi.println(cmd);
错误:
")stdin:1: '"GET /json.htm?type=command¶m=udevice&idx=2&nvalue=0&svalue=11 HTTP/1.1Host: 192' 附近未完成的字符串
\r\n
Lua在 GET 请求中看不到吗?