httpclient logon automaticly

Posted on 2007-09-30
Medium Priority
Last Modified: 2012-05-05

i have to download a file from a url in my application but before this, the site requires me to logon. how i can accomplish these steps in java with apache httpclient.

Question by:komputer
  • 2
  • 2
LVL 23

Expert Comment

ID: 19989148
Depends on kind of authentication site needs -
If the authentication is HTTP authentication, you can set the
Basic/Digest/NTLM credentials appropriately.
Otherwise, you should use form filling approach (checkout this library:

Author Comment

ID: 19989252
i do not know what kind of authontication that needs and how i can know?
the page i want to go: http://imeidb.gsm.org/imei/reports/SystemGeneratedReports.jsp

btw: i would like to use apache http client.

could you send code please?

LVL 23

Accepted Solution

Ajay-Singh earned 410 total points
ID: 19989265
Its form based authentication. Look at "Working with forms" section here http://httpunit.sourceforge.net/doc/cookbook.html
LVL 92

Expert Comment

ID: 19989273
> could you send code please?

see the  link i postedabove

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question