Redirection occurred during the HttpURLConnection request. Why is the return code still 200?

The

code is very simple. I know that visiting URL without login will be redirected to another website, but HttpURLConnection has been redirected, and the printed URL is indeed redirected. I use the package grab tool and browser to grab the package and return 302. Why is the HttpURLConnection return code 200?

Mar.22,2021

many HTTP libraries follow redirected connections by default. Generally, there are parameter settings that do not automatically redirect

.
Menu