1

I'm trying to control my Roku from a java application. You do this by sending a html POST request with no body to your Roku's ip (http://192.000.1.82:8060/keydown/Left). Currently I have this code:

HttpURLConnection urlConn;
URL mUrl = new URL("html://192.000.1.82:8060/keypress/Right");
urlConn = (HttpURLConnection) mUrl.openConnection();
urlConn.setRequestMethod("POST");

However, nothing seems to be happening. The SDK says "keydown is followed by a slash and the name of the key pressed. Keydown is equivalent to pressing down the remote key whose value is the argument passed. This command is sent via a POST with no body." Maybe I'm misinterpreting this?

What am I doing wrong? Any help is appreciated.

Nas Banov
  • 28,347
  • 6
  • 48
  • 67
Dan13_
  • 193
  • 1
  • 2
  • 16
  • Did'nt get you actually . would you please post any error log – Vikrant Kashyap Apr 01 '16 at 17:14
  • There isn't one, the program runs through. However, it does not trigger on my Roku and surely that code is a POST request with no body seen as it has no body? – Dan13_ Apr 01 '16 at 17:17

1 Answers1

0

This is already answered . Please check the following link

[Java - sending HTTP parameters via POST method easily

Community
  • 1
  • 1
Jay
  • 42
  • 11