Clearly I need a REST
Jeff Lockyear
Posts: 147
As an Accidental Programmer I sometimes run across a problem that requires knowledge, rather than brute force, and I think this is one of those times.
I have one of the little Roku media streamers, which has external control support (found here):
http://sdkdocs.roku.com/display/sdkdoc/External+Control+Guide
I can establish a connection with my master on the correct port, but I just can't get my commands acted upon. I've tried various iterations of what's in the examples, but it seems (for example) a Home button emulation should be sent as (after a successful connection) POST /keypress/Home
At least I think so. If anyone can offer an educated opinion as to how the string needs to actually be formatted I'd appreciate it. All the online help examples involve various.cryptic.libraries that I don't have the depth to understand.
I have one of the little Roku media streamers, which has external control support (found here):
http://sdkdocs.roku.com/display/sdkdoc/External+Control+Guide
I can establish a connection with my master on the correct port, but I just can't get my commands acted upon. I've tried various iterations of what's in the examples, but it seems (for example) a Home button emulation should be sent as (after a successful connection) POST /keypress/Home
At least I think so. If anyone can offer an educated opinion as to how the string needs to actually be formatted I'd appreciate it. All the online help examples involve various.cryptic.libraries that I don't have the depth to understand.
0
Comments
Can you post the code with your string build too? Might help.
E
Thanks! I have the Roku up on the TV and I'm not on the Home screen, so I would know if this command worked.
You can find the entire module here: https://github.com/nickmil/BoxeeBox
As you can see, there is a lot of information required of an HTTP header. A tool that will come in quite handy as you play more with RESTful APIs is the POSTman REST client. It's a Chrome app that breaks down everything that happens in a REST request and response.
I replaced your GET with POST in the function and gave it a try with my Home command and it worked, thanks. I guess the Roku document assumes a level of http/REST knowledge that I don't have.
Cheers!
Agreed. There is a lot of header information that typically isn't needed in the scope of devices/services we are communicating with.