我的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'
Lua在GET请求中看不到\r\n
吗?
答案 0 :(得分:2)
您可能需要使用双> dput(data[2:5,])
structure(list(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.535714285714286,
0.535714285714286, 0.535714285714286, 0.535714285714286,
0.535714285714286, 0.535714285714286, 0.535714285714286,
0.535714285714286, 0.535714285714286, 0.535714285714286,
0.535714285714286, 0.535714285714286, 0.535714285714286,
0.535714285714286, 0.535714285714286, 0.535714285714286,
0.535714285714286, 0.535714285714286, 0.535714285714286,
0.535714285714286, 0.518518518518518, 0.518518518518518,
0.518518518518518, 0.518518518518518), .Dim = c(4L, 8L))
,具体取决于您使用它的位置(例如,发送框)。
由于您使用\\
来转义引号,\"
应该可以这样做。