Send a json command to an app at a known port/address?

32 Views Asked by At

A total newbie here, apologies in advance.

I have an app running on my win desktop for controlling 3 GoPro cameras remotely and independently. The app is here. The author of the app has provided a command server interface which he describes here.

The app runs at http://192.168.0.108:809 (port 809).

In my command server I get this:

C:\>curl http://192.168.0.108:809
{
    "error": "unkown error",
    "status_code": -1
}

C:\>

... and referring to his list of valid commands, that is expected for HTTP status 400, bad request.

Can somebody please help me to send:

{
    "command": "getAllCameras"
}

to http://192.168.0.108:809?

What would be the syntax of such a command after the C:\> prompt in my command server?

I have tried all sorts of posts and sends suggested by extensive web searching on the question, but I am drowning in information which just seems too complicated.

Edit: Reino kindly showed me that be a curl command expressed as a single line:

curl.exe -d "{"command":"getAllCameras"}" "http://192.168.0.108:809"

I am now trying to figure out when and where to use the escape character \

My next challenge is with this one:

{

"command": "sendCameraCommand",

"cameras": ["GoPro 2281"],

"cameraCommand": "startRecording"

}

How to get a single curl line for that? (the comma throws me)

0

There are 0 best solutions below