You probably need to add the proper (basic) authentication header using the
addRequestHeader() for this to work:

does it only affect the next download session, will it affect all the download 
session?

btw, is basic scheme api available in android?




nicefuture

From: Nikolay Elenkov
Date: 2012-06-15 15:30
To: android-developers
Subject: Re: [android-developers] about HTTP Auth in DownloadManager
On Fri, Jun 15, 2012 at 4:17 PM, nicefuture <[email protected]> wrote:

>
> Then, I tried to implement the http authentication in my application, BUT
> I failed, I found the behavior is very strange, below is the step:
>
>
>
> 1.牋牋牋 I already know the website抯 userid and password, I tested using
> the path contain userinfo, as below:
>
> http://tma:[email protected]/Onlinetest/download/To_Content/descriptors/audio/dd_audio_mp4.dd
>
>
> 2.牋牋牋 In my guess, the Download Manager should work well, and status
> 200 should be reported. BUT, still status 401 is reported. And from the
> tcpdump, it is very strange, it obviously successfully be authenticated and
> retrieve the content, but then the client start a new http get, which cause
> to the status 401 occurred.牋 I wonder why the extra http get procedure
> happened??
>

You probably need to add the proper (basic) authentication header using the
addRequestHeader() for this to work:

http://developer.android.com/reference/android/app/DownloadManager.Request.html#addRequestHeader(java.lang.String,
java.lang.String)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to