How to send a request after httpURLconnection redirection

give me a brief answer and describe my question.
my purpose is to visit website A, but if I do not log in to website A directly, I will be redirected to website B.
that is to say, I must go through the login operation of website B to access the target website. After I connect to website A with httpURLconnection, it is actually website B. if I submit login information, if I visit website An again?
httpURLconnection request is to submit data first, then accept the resources of the web page, and then I want to operate on the resources received. What should I do? I don"t want to be able to submit any more requests!

Mar.22,2021
Menu