HTTP API problem

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
Posts: 27
Joined: 30 Oct 2015 18:58

HTTP API problem

Post by qbawawa »

I'm trying to authenticate to use HTTP API. I try to send json request to url with json {"form":"true","login":"admin","password":"my_password","keepme":"false","default_ui":"1"} but it doesn't work - I don't get any response nor cookie. What can be wrong?

Posts: 110
Joined: 25 Jul 2015 15:03

Re: HTTP API problem

Post by AlphaX2 »

Have you also set the Header? "Accept" and "Content-Type" should both be "application/json" and it needs a POST request! Also you may try it with the offical IP of your RasPi.

User avatar
Posts: 5507
Joined: 26 Jan 2011 19:36

Re: HTTP API problem

Post by PoltoS »

Please look on (How to execute API commands via HTTP API?):

To use HTTP API you need to authenticate and then pass particular command to the server.

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"form": true, "login": "admin", "password": "admin", "keepme": false, "default_ui": 1}' -c cookie.txt

curl -b cookie.txt

or just

curl -v -u admin:admin

Post Reply