Using java Syntax Highlighting
- DataInputStream is;
- URLConnection con;
- String urlString = "http://192.168.157.35:8080/myown/Login.do";
- String username="abhi";
- URL url;
- try {
- url = new URL(urlString);
- con=url.openConnection();
- if (con instanceof HttpURLConnection)
- {
- System.out.println("This is HttpURLConnection");
- ((HttpURLConnection)con).setRequestMethod("POST");
- con.setDoInput(true);
- con.setDoOutput(true);
- dos = new DataOutputStream(con.getOutputStream());
- dos.writeUTF(username);
- dos.close();
- }
- }
- catch (IOException e) {
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4




