You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

新手求助:如何向指定端口的CameraTools发送JSON命令?

Windows下CameraTools接口的CURL命令写法(含JSON数组场景)

Windows的CMD和PowerShell环境对引号转义的规则不同,以下分别给出两种环境下的正确单行命令:

CMD环境

在CMD中,双引号需要用两个连续双引号来转义,确保JSON结构被完整解析:

  1. 获取所有相机列表:
curl -X POST -H "Content-Type: application/json" -d "{""command"":""getAllCameras""}" http://192.168.0.108:809
  1. 发送录制命令给指定相机:
curl -X POST -H "Content-Type: application/json" -d "{""command"":""sendCameraCommand"",""cameras"":[""GoPro 2281""],""cameraCommand"":""startRecording""}" http://192.168.0.108:809

PowerShell环境

PowerShell支持用单引号包裹JSON字符串,内部双引号无需转义,写法更简洁:

  1. 获取所有相机列表:
curl -X POST -H "Content-Type: application/json" -d '{"command":"getAllCameras"}' http://192.168.0.108:809
  1. 发送录制命令给指定相机:
curl -X POST -H "Content-Type: application/json" -d '{"command":"sendCameraCommand","cameras":["GoPro 2281"],"cameraCommand":"startRecording"}' http://192.168.0.108:809

注意

  • 确保系统已预装curl(Windows 10 1803及以上版本默认包含),如果没有需单独安装。
  • -H "Content-Type: application/json" 参数必须添加,告知接口接收的是JSON格式数据。

内容的提问来源于stack exchange,提问作者Gerald_D

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 01:55:04