I’m writing an app that will interact with site. In that site authentication is trough AJAX POST request.How can i execute that request in my Android app?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You have to differentiate a bit here:
AJAX is only the technology that initiates an HTTP Post Request from the Client Browser to the website. In your case, you want to send that HTTP Post Request from your Java application.
First you have to find out which URL is requested and what key-value-pairs are send within that request, which you can do by analyzing the AJAX code or by using some browser plugin or Wireshark to show you the raw POST request. Then you can submit that request using e.g. Apache’s
HttpClient(already available in the Android SDK). For finding out how to do that, take a look at this answer.