I am trying to make JSON calls to HS from a linux machine. It is on the same subnet. No authority issues.
First, I make the call with the entire website totally filled out. This works fine. Next, I use the CURL JSON to pass the arguments.
I was doing this in HS3 I believe and from Linux and more importantly from the iOS shortcut tool.
I tried a myriad of options here, but I wasn't able to get HS to respond to the JSON command no matter what I did.
Can someone confirm this?
--- SCRIPT----------
curl -v -H 'Content-type: application/json' http://192.168.0.5/JSON?request=hsversion
curl -X GET \
-H "Content-type: application/json" \
-H "Accept: application/json" \
-d {"action":"hsversion"} \
"http://192.168.0.5/JSON" -v
----RESULTS-------------------------
source runmedo
* Trying 192.168.0.5...
* TCP_NODELAY set
* Connected to 192.168.0.5 (192.168.0.5) port 80 (#0)
> GET /JSON?request=hsversion HTTP/1.1
> Host: 192.168.0.5
> User-Agent: curl/7.58.0
> Accept: */*
> Content-type: application/json
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: HomeSeer
< Cache-Control: no-cache
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Accept-Ranges: none
< Content-Length: 24
<
* Closing connection 0
{ "Response":"4.1.2.0" }*
Trying 192.168.0.5...
* TCP_NODELAY set
* Connected to 192.168.0.5 (192.168.0.5) port 80 (#0)
> GET /JSON HTTP/1.1
> Host: 192.168.0.5
> User-Agent: curl/7.58.0
> Content-type: application/json
> Accept: application/json
> Content-Length: 18
>
* upload completely sent off: 18 out of 18 bytes
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: HomeSeer
< Cache-Control: no-cache
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Accept-Ranges: none
< Content-Length: 35
<
* Closing connection 0
{ "Response":"Error, bad request"
First, I make the call with the entire website totally filled out. This works fine. Next, I use the CURL JSON to pass the arguments.
I was doing this in HS3 I believe and from Linux and more importantly from the iOS shortcut tool.
I tried a myriad of options here, but I wasn't able to get HS to respond to the JSON command no matter what I did.
Can someone confirm this?
--- SCRIPT----------
curl -v -H 'Content-type: application/json' http://192.168.0.5/JSON?request=hsversion
curl -X GET \
-H "Content-type: application/json" \
-H "Accept: application/json" \
-d {"action":"hsversion"} \
"http://192.168.0.5/JSON" -v
----RESULTS-------------------------
source runmedo
* Trying 192.168.0.5...
* TCP_NODELAY set
* Connected to 192.168.0.5 (192.168.0.5) port 80 (#0)
> GET /JSON?request=hsversion HTTP/1.1
> Host: 192.168.0.5
> User-Agent: curl/7.58.0
> Accept: */*
> Content-type: application/json
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: HomeSeer
< Cache-Control: no-cache
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Accept-Ranges: none
< Content-Length: 24
<
* Closing connection 0
{ "Response":"4.1.2.0" }*
Trying 192.168.0.5...
* TCP_NODELAY set
* Connected to 192.168.0.5 (192.168.0.5) port 80 (#0)
> GET /JSON HTTP/1.1
> Host: 192.168.0.5
> User-Agent: curl/7.58.0
> Content-type: application/json
> Accept: application/json
> Content-Length: 18
>
* upload completely sent off: 18 out of 18 bytes
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: HomeSeer
< Cache-Control: no-cache
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Accept-Ranges: none
< Content-Length: 35
<
* Closing connection 0
{ "Response":"Error, bad request"
Comment