X-Received: by 10.224.185.79 with SMTP id cn15mr8804365qab.4.1364298367720; Tue, 26 Mar 2013 04:46:07 -0700 (PDT) X-Received: by 10.49.5.129 with SMTP id s1mr927610qes.39.1364298367637; Tue, 26 Mar 2013 04:46:07 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!t2no17309080qal.0!news-out.google.com!k8ni11100qas.0!nntp.google.com!ca1no7834143qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Tue, 26 Mar 2013 04:46:07 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=68.56.123.172; posting-account=-VTU1AoAAAAj8_Yg-fSOSMK2kXzWy-EX NNTP-Posting-Host: 68.56.123.172 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: POST to secure server From: RVic Injection-Date: Tue, 26 Mar 2013 11:46:07 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.lang.java.programmer:23127 I have an application that must run in windows which must post to a servlet= running on a secure server. I can WinSCP into that server, and I can use P= uTTY to ssh into that server. But I am quite clueless how I can post to a s= ervlet there? Is there something I can pass in posting, or something I do w= ith my URLConnection or URL variable to allow me access as I get with WinSC= P or PuTTY? Thank you. URL postURL =3D new URL(servletURL); HttpURLConnection conn =3D (HttpURLConnection) postURL.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); conn.setUseCaches(false); conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"= );=20 conn.connect(); StringBuilder sb =3D new StringBuilder(); =09 sb.append(vtkey+"=3D"+ paramval); =09 out.write(sb.toString()); out.flush();