579195 (9) [Avatar] Offline
#1

Hi Guys,

Building The Web Of Things Page 188 (213 OF 346) -
the server program - works...
the googlechrome links to http://localhost:8484/pi/sensors/pir - works

when I try through Windows cmd either of below :

curl -i -H "Accept: application/json" \
-X GET 'http://localhost:8484/pi/sensors/pir'
OR

curl -i -H "Accept: application/x-msgpack" \
-X GET 'http://localhost:8484/pi/sensors/pir'

It states

curl: (6) Could not resolve host: \-X
curl: (6) Could not resolve host: GET
curl: (1) protocol "'HTTP" not supported or disabled in libcurl

CAN YOU PLEASE HELP ??





domguinard (69) [Avatar] Offline
#2
Hi,

This could be a Windows command copy/paste parsing issue, can you try:

curl -i -H "Accept: application/x-msgpack" -X GET http://localhost:8484/pi/sensors/pir
instead?

and

curl -i -H "Accept: application/json" -X GET http://localhost:8484/pi/sensors/pir


instead?
579195 (9) [Avatar] Offline
#3
Yes. That was the problem. Thank You.