Code is:
Do not woryy about the SSL code, Just look at the GET vs POST. GEt always retyurns something but POST doesn't
<CODE>
public void run() throws Exception {
String thisLine;
// Get a SocketFactory object for creating SSL sockets
SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
// Create a secure socket connected to the HTTPS port (port 443) of a server
SSLSocket sslsock = (SSLSocket) factory.createSocket("iweb.verizon.com", 443);
//SSLSocket sslsock = (SSLSocket) factory.createSocket("java.sun.com", 443);
// Get the certificate presented by the web server. This may throw an
// exception if the server didn't supply a certificate. Look at the
// issuer of the certificate and decide if it is trusted.
SSLSession session = sslsock.getSession();
X509Certificate cert = (X509Certificate)session.getPeerCertificateChain()[0];
String issuer = cert.getIssuerDN().getName();
// Assuming we trust the certificate, we now use the socket just like a normal
// java.net.Socket object. So send a HTTP request and read the response
PrintWriter out = new PrintWriter(sslsock.getOutputStream());
//out.print("GET " + "/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" + " HTTP/1.0\r\n");
out.write("POST " + "/eweb/secure/web/jsp/index.jsp" + " HTTP/1.0\r\n\r\n");
out.flush();
// Next, read the server's response and print it to the console.
BufferedReader in =
new BufferedReader(new InputStreamReader(sslsock.getInputStream()));
String line;
while((line = in.readLine()) != null) System.out.println(line);
out.close();
// Finally, close the socket.
sslsock.close();
</CODE>
}