httpclient logon automaticly

Posted on 2007-09-30
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
    LVL 23

    Expert Comment

    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:
    LVL 92

    Expert Comment


    Author Comment

    i do not know what kind of authontication that needs and how i can know?
    the page i want to go:

    btw: i would like to use apache http client.

    could you send code please?

    LVL 23

    Accepted Solution

    Its form based authentication. Look at "Working with forms" section here
    LVL 92

    Expert Comment

    > could you send code please?

    see the  link i postedabove

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Title # Comments Views Activity
    Using java code in .Net/c#: namespace issue 3 38
    Receive file in Servlet 1 25
    word0 challenge 4 35
    @SBGen Method 3 16
    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    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…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now