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?
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 eg Apache's HttpClient
(already available in the Android SDK). For finding out how to do that, take a look at this answer.
上一篇: 春天,使用POST重定向到外部URL
下一篇: 发送一个AJAX POST请求