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’s 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

