Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7161839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:38:07+00:00 2026-05-28T13:38:07+00:00

I am trying to log into a site and load a webpage programatically in

  • 0

I am trying to log into a site and load a webpage programatically in android. Meaning, I have the password and login and need to submit a webform and get the response page. I tried the code here: Doing HTTP Post with Android
but I think I may be doing it wrong.

If this is the site I’m trying to access: http://goo.gl/eiBhP
and my code is

HttpClient httpclient =  new DefaultHttpClient(httpParameters);
HttpPost httppost = new HttpPost(Constants.MAIN_URL);
List<namevaluepair> nameValuePairs = new ArrayList<namevaluepair>(2);
nameValuePairs.add(new BasicNameValuePair("username", "correctusername"));
nameValuePairs.add(new BasicNameValuePair("password", "correctpassword"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpClient.execute(httpost);

Then I should be able to use

BufferedReader br = new BufferedReader(new InputStreamReader(
    entity.getContent()), 8096);

to get the response. The id of the login and pass on the site ate username and password. should I also somehow submit the button as a name value pair? I cant seem to get this to work, it just returns the login page. Please Help. I’ve tried reading over the other similar questions but I can’t seem to get it to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:38:08+00:00Added an answer on May 28, 2026 at 1:38 pm

    Basically, you need to make sure that your code is submitting exactly the same information as the webpage.
    As Selvin points out, there’s a good chance that the website is using some form of tracking – be it in hidden input values, cookies or some other state-based data.

    You need to look at the source of the login webpage and understand what it is doing when you submit login details – you don’t necessarily need to know what all the values mean, but your code must submit the same POST data.

    If the website is using state information, you won’t be able to hard-code those input values in your code. You’ll probably need to retrieve a new instance of the login webpage each time using a HTTP GET request and then parse the data to extract the relevant state data. Don’t forget that they may also be using cookies which you may need to submit.

    All in all, you probably need to do a lot more work to get it to a working state. Not trying to dissuade you (and I don’t know what you’re trying to achieve), but perhaps it’s easier just to use the website!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to submit this webform and log into this site: https://www.kalahari.net/profile/pipeline/signin.aspx I
I'm trying to write a perl script to log into a password protected site.
Using Forms Authentication in ASP.NET MVC when trying to log back into a site,
So I am trying to log into my site using an NSMutableURLRequest which presents
I am currently trying to log into a site using Python however the site
Basically, I'm trying to log into a site. I've got it logging in, but
In Java, I'm trying to log into an FTP server and find all the
I am trying to log some input values into an array via jquery and
I have been trying to have a small login widget that I embed within
I am trying to design an Picture Upload feature into a web site. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.