[Solved] Strings for cUrl to access API can you help explain

Hi,

I am working on connecting to my core from MS Access my first step is connecting using cUrl. I followed the web site and come up with the following address: https://api.spark.io/v1/devices/my_device_id/pumpOnOff \ -d access_token=my_device_access_token \ -d cmd=start

i get the following response:

{
“id”: “my_device”,
“name”: “clive_test”,
“last_app”: null,
“connected”: true,
“return_value”: 1
}
curl: (6) Could not resolve host:
curl: (6) Could not resolve host: \

I have two questions:

  1. Why an I getting the final part about cant resolve host
  2. What does the \ -d mean

Many thanks in advance for your advice.

best regards,
Clive

A day of answering myself. It appears the \ -d does not require the \ and -d is a message to curl to tell it the request is a Post. Sorry to have troubled you.

best regards,
Clive

2 Likes

Curl can open more than one URL so you can do

curl url1 url2 ... urlN

It was interpreting the “” as a URL.