in reply to Re^2: How to authenticate and upload file to a secured server
in thread How to authenticate and upload file to a secured server

If it uses Basic Authentication, you'll need to call $ua->credentials, or create and use a subclass of LWP::UserAgent that overrides get_basic_credentials.

By definition, if Basic Authentication was used, you'd get a 401 response including a "WWW-Authenticate: Basic realm="..."" header. Your site either doesn't use Basic Authentication, or you're not accessing the right page.

Basic Authentication doesn't have any domain component. Just realm, user and password. Realm is set by the server and is not editable. I've seen the dialog to which you refer in the past, and it's not Basic Authentication. I don't know what it is.

Look at the headers in your trace. You never got any cookie. That's why the file is empty. Basic Authentication doesn't use cookies anyway.

Replies are listed 'Best First'.
Re^4: How to authenticate and upload file to a secured server
by KarthikK (Sexton) on Oct 19, 2007 at 07:46 UTC
    Hi, thanks for your response. I tried with the $ua->credentials(). I got the following result

    1. I tried the https website, i always get status code 200 OK
    2. I tried with http://www.google.com, i get 407 Proxy Authentication Required
    3. I tried with a local intranet website, code works fine

    Also in the cookeis file i always get this only #LWP-Cookies-1.0
    any help would be really appreciated. i am struggling with this for last 2 weeks :-(

    Thanks
    Karthik