When I use okhttp,this problem happens.When I use httpclient everything goes well.Why?
Typically this happens when you get into a redirect loop, or when you authenticate with the wrong username, and then retry with the same wrong username. You can fix your Authenticator to check if it is a follow-up request and not retry in that case.
Please ask any follow up questions on Stack Overflow.
Thank guy.Why Httpclient does not exist this question?
Apache one? They are Legacy HTTP client that is unsupported on Android.
@iNoles You are right.But only httpclient can solve the redirect successfully.I even used HttpConnection nad and failed.
Most helpful comment
Typically this happens when you get into a redirect loop, or when you authenticate with the wrong username, and then retry with the same wrong username. You can fix your
Authenticatorto check if it is a follow-up request and not retry in that case.