import java.net.*; import java.io.*; /** * Programm loeb aadressilt vastaval distsipliinil osalevad nimed. */ class ReadURL2 { public static void main(String[] args){ try { URL mesa = new URL("http://server.mesa.arizona.edu/"+ "memberservices/MemberSearch.asp"); URLConnection mesaConnection = mesa.openConnection(); mesaConnection.setDoOutput(true); //lubab POST abil saata mesaConnection.setUseCaches(false); PrintWriter out = new PrintWriter (mesaConnection.getOutputStream(), true); out.println("Title=any&Area1=any&Discipline1=20"); String inputLine; BufferedReader in = new BufferedReader(new InputStreamReader(mesaConnection.getInputStream())); while ((inputLine = in.readLine()) != null) System.out.println(inputLine); out.close(); in.close(); } catch(Exception e) { System.out.println("Problem: "+e); } } }