Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 8

Re: Question on using POST /launch/

Hm, well it works for me without headers. I do "telnet 8060" and then enter "POST /launch/12 HTTP/1.1" followed by two newlines, and I get a 200 OK response. But there's certainly no harm in adhering to the spec by sending the Host header.

0 Kudos
Level 7

Re: Question on using POST /launch/


what app are using for the POST? (hyperterminal, c, c#, C++ java etc etc etc, mac, pc, linux etc etc)
0 Kudos
Level 7

Re: Question on using POST /launch/


I've been using both VB and even AutoIt, from/on a PC (XP and Vista). I should note that I also compiled and ran the sample SDK program related to ECP (it uses HTTP 1.0). One thing I noticed with it was that where it does a get/apps the response contains no apps. It gets the header part of the repsonse message back fine, and shows an appropriate number of bytes that should be in the message body. But there is no message body (ie. there's the header , but no data).

A strange thing is that I had not been using the additional header in POSTs (or GETs). Keypress seemed to work without it. Get/apps had random problems, sometimes there'd be a usable response - sometimes not. But when I got to trying to launch apps nothing worked until I added the additional HOST: header. Now I've gone back and added the header to eveything I do (except the SSDP Discovery of course). That's seems to have produced reliable exchanges.
0 Kudos
Level 9

Re: Question on using POST /launch/

The Roku shouldn't be requiring the Host header, but maybe your client libraries do??

The sample app should not be requiring the header either. We tested it on Linux and Windows.

0 Kudos
Level 7

Re: Question on using POST /launch/

For my Philips pronto 9400 remote here is the script that I use. I have a page on my remote that shows my "favorites", In each button I call the function:

roku_launch(11); //where the value is the id of the channel.

In the activities page I store the actual function :

function roku_launch(channel) {
var url = CF.widget("aURL","PARAMETERS").label;
var timeout = CF.widget("aTIMEOUT","PARAMETERS").label;
var socket = new TCPSocket(true);
socket.connect(url, 8060, timeout);
socket.write("POST /launch/"+channel+ " HTTP/1.1\r\n\r\n");

This works great.

0 Kudos