Java - HTTP Request
Java - HTTP Request
//set up url String username = "sterling_archer@ikanow.com"; String hashedpassword = "WZRHGrsBESr8wYFZ9sx0tPURuZgG2lmzyvWpwXPKz8U%3D"; //don't forget to URLEncode your arguments String address = "http://infinite.ikanow.com/api/auth/login/" + username + "/" + hashedpassword; //send request URL url = new URL(address); URLConnection urlConnection = url.openConnection(); ((HttpURLConnection)urlConnection).setRequestMethod("GET"); //read back result BufferedReader inStream = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); StringBuilder strBuilder = new StringBuilder(); String buffer; while ( (buffer = inStream.readLine()) != null ) { strBuilder.append(buffer); } inStream.close(); //print out response json System.out.println(strBuilder.toString());