eta_wen
eta_wen

Reputation: 13

Sending an AJAX POST request

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?

Upvotes: 1

Views: 15072

Answers (1)

Jan Gerlinger
Jan Gerlinger

Reputation: 7415

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.

Upvotes: 9

Related Questions