This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Simulate a http post in  RSS feed

Maky Chopra
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Desparatly need some hlp here.. Any tips will be greatly appreciated. Did not get an answer anywhere else, so thought of posting in this forum..
I had posted related q's some time back.. Basically, I'm writing a java program to download a text file from the internet.. Its an https connection to a SSL 2.0 server
These were the first two hurdle.. I learnt to use JSSE to connect thru https but SSL 2.0 is not supported.. Then I got a third party package called ICE SSL/ ICE STORM BROWSER and using its jar files (they inherit from, I was able to connect and download from SSL 2.0
Now, if an authentication box pops up, I can use the class to authenticate myself, right ? Can this class be used for html (form based) logins ?
The problem is that my url is, say, and I get the html of the download.cgi file (please login.. ) when I run my program.
Please help..
Any way I can authenticate myself to the site for this purpose ?
code Monkey
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For posting html forms (e.g. for login) you can use codes like
URLConnection connection = url.openConnection();
PrintWriter out
= new PrintWriter(connection.getOutputStream());
//getting username and pwd from an already initialized properties file.
Enumeration enum = nameValuePairs.keys();
while (enum.hasMoreElements())
{ String name = (String)enum.nextElement();
String value = nameValuePairs.getProperty(name);
char ch;
if (enum.hasMoreElements()) ch = '&'; else ch = '\n';
out.print(name + "="
+ URLEncoder.encode(value) + ch);
//if you now need to read what the server resopnds when u log in.....
BufferedReader in;
{ in = new BufferedReader(new
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!