I can successfully send the following curl command to a camera:
- Trying 10.1.1.85...
- TCP_NODELAY set
- Connected to 10.1.1.85 (10.1.1.85) port 80 (#0)
GET /ctrl/rec?action=start HTTP/1.1
Host: 10.1.1.85
User-Agent: curl/7.55.1
Accept: /
< HTTP/1.1 200 Ok
< Content-Length: 29
< Cache-Control: no-cache
< Content-Type: application/json; charset=utf-8
< Connection: close
<
{"code":0,"desc":"","msg":""}* Closing connection 0
the code 0 indicates that the operation executed successfully, and the camera indeed starts recording.
However, when I try to reproduce what I think is functionally the same command using the Ethernet library:
. . .
client.println("GET /ctrl/mode?action=start HTTP/1.1");
client.println("Host: 10.1.1.85");
client.println("User-Agent: curl/7.55.1");
client.println("Connection: close");
client.println();
. . .
the response looks like this:
HTTP/1.1 200 Ok
Content-Length: 30
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Connection: close
{"code":-1,"desc":"","msg":""}
and the camera does not start recording.
There are some differences in the packet, but I think they're valid. Can you see anything wrong with the way I form my request as compared with the way curl.exe forms it?
Thank you,