bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Wget Question


From: Tim Ruehsen
Subject: Re: [Bug-wget] Wget Question
Date: Wed, 27 Jun 2012 10:43:32 +0200
User-agent: KMail/1.13.7 (Linux/3.2.0-2-amd64; KDE/4.8.4; x86_64; ; )

Hi Michael,

> I'm trying to use wget 1.13.4 from a command line to access a web page
> using Digest Authentication and I keep getting HTTP/1.1 401 Unauthorized
> response.   Below is my code and the response.  Any suggestions would be
> appreciated.
> 
> wget --debug --server-response --user-agent="" --ignore-case --user=admin
> --password=abc -O - http://10.107.70.21:8080/admin/console/View.jsp
>...

I assume that you double checked username and password, e.g. by opening your 
URL with a web browser.

Well, some servers need a proper "User-Agent" header in the request to behave 
as expected. Try again without --user-agent .
If it doesn't work, try it with --user-agent="Mozilla/5.0".

If that still doesn't work, try simulating your web browser by providing 
additional header lines with --header option, especially the Accept and 
Accept-Language headers.

E.g. my iceweasel/firefox request to localhost:8000 looks like:
GET / HTTP/1.1
Host: localhost:8000
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20100101 
Firefox/10.0.5 Iceweasel/10.0.5
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie: _pk_id.14.1fff=27dbeea2e0aa9175.1309258118.1.1309258118.1309258118

So I would try
wget --user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20100101" 
--header="Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" --
header="Accept-Language: en-us,en;q=0.5"

If you still have no success, let us know.

Regards, Tim

> Regards,
> 
> Michael Tarkowski
> Sales & Marketing Application Architecture
> Chrysler Group LLC
> Office: +01.248.838.4866   Mobile: +01.248.891.5097
> Email:  address@hidden<mailto:address@hidden>
> Mobile Text: address@hidden<mailto:address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]