Basically what I'm trying to do is connect to the Pastebin API with a PHP page I created. It seems as if the parameters are not inputting. Here's my code:
String urlParameters = "?api_dev_key=" + main.getKey() + "&api_user_name=" + username + "&api_user_password=" + password; URL url = new URL("http://pastebinclient.tk/server/login.php" + urlParameters);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestProperty("Content-Language", "en-US");
connection.setRequestProperty("Accept", "*/*");
connection.setRequestProperty("User-Agent", "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Safari/537.36");
connection.setUseCaches(false);
connection.setDoOutput(true);
I used http://hurl.it with the same parameters and it worked fine. On my page, it is setup so that if the parameters aren't all inputted then it returns a message saying so, and that's what has been happening. Sorry that I'm asking a question that's already been answered, but the answers haven't helped.