There's a lot that can go wrong here.
First,
you should make sure that the URL is valid by opening it with a browser.
Next, if you read the documentation for
URLConnection, you'll see that the way you use the class (and subclass HTTPUrlConnection) is that you manipulate the parameters, connect to the server then receive the resource. Your code connects, then attempts to manipulate the request. Not good.
Next, you aren't encoding the request parameters. Since a URL cannot contain characters that are considered control characters (spaces for one) you must encode the parameters.
URLEncoder is provided for just this purpose.
Finally, you need to close your output stream. The request to the server isn't complete until you do.
Have a look at
this example and see if you can get it working for you.