The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

579195 (12) [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 (71) [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 (12) [Avatar] Offline
#3
Yes. That was the problem. Thank You.