r/crestron • u/guitarman181 • Mar 16 '16
Crestron - rest interface problems - thoughts?
I have a device that has a restful api. The following command works http://username:password@192.168.1.100:50001/rest/nodes/44 01 11 1/cmd/DFON This command turns an inston light ON.
I want to recreate this command in a Crestron module. I created a TCPIP/Client with a serial IO module that sends the following serial string: GET /rest/nodes/44 01 11 1/cmd/DFON HTTP/1.1\r\nAuthorization: username:password\r\n\r\n
The TPCIP/client module has the IP address of the device and port.
My serial IO string does not work. Does anyone know what I need to change or do differently to make it work?
View all comments
Show parent comment
1
u/[deleted] Apr 21 '16 edited Apr 21 '16
You probably need to Base64 Encode the Authorization: string per the HTTP 1.1 spec:
https://en.wikipedia.org/wiki/Basic_access_authentication
http://decodebase64.com/
If you Base64 encode "username:password" it ends up being "dXNlcm5hbWU6cGFzc3dvcmQ="