Android Question OkHttpUtils2 download HTML with login form

Discussion in 'Android Questions' started by peacemaker, Aug 7, 2019.

  1. peacemaker

    peacemaker Well-Known Member Licensed User

    HI, All

    Is it possible to download by OkHttpUtils2 the page that is behind the auth form with login\password ?
    Seems, job.UserName and job.Password are for the server auth only.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You will need to understand how the form's data is being sent to the server and then make a similar request with OkHttpUtils2.
     
  3. peacemaker

    peacemaker Well-Known Member Licensed User

    I know that form uses POST and know the field names. Should i make PostMultipart with fields=values ?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Use the browser developer tools to see the request.
     
  5. peacemaker

    peacemaker Well-Known Member Licensed User

    So, is it no universal way to download any web-pages of any web-site, if you know only the login\pass of the auth form ?
     
  6. DonManfred

    DonManfred Expert Licensed User

    No
     
    Erel and peacemaker like this.
  7. peacemaker

    peacemaker Well-Known Member Licensed User

    But, finally, to make web-page crowling, with auth, the form must be processed ?
    1) find "method", URL=action
    2) find username and password fields names
    3) and make HTTP-request of method-kind to URL, passing login and password values in the correct field names
    ?

    And how to get other web-pages after login ? I ask about the algorithm only.
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    There are many possible options. You should learn how this specific site works.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice