Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use httpGet to get the pages and httpPost to post the results when the user presses submit. All you have to do is make sure that the post carries the data that the web page expects, and in the format it expects. </p> <p>A good way to check what is required is use the Firefox Live HHTP Headers add on (https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/).</p> <p>For example the GET might be</p> <pre><code>URI uri = new URI(&lt;your URL here&gt;); HttpGet request = new HttpGet(uri); HttpResponse response = defaultHttpClient.execute(request); HttpEntity entity = response.getEntity(); String content = EntityUtils.toString(entity); </code></pre> <p>Then you put up your Android view with edit text boxes and buttons etc. When the user presses Submit, you get the text form the edit text box, and then construct a POST as below.</p> <pre><code>URI uri = new URI(&lt;your URL here - without a host&gt;); HttpPost request = new HttpPost(urri); request.setHeader("Content-type", "application/x-www-form-urlencoded"); List&lt;NameValuePair&gt; bodyParams = new ArrayList&lt;NameValuePair&gt;(); bodyParams.add(new BasicNameValuePair(&lt;parameter name string&gt;, &lt;parameter value string&gt;); // repeat additional bodyParams.add() as necessary for further parameters request.setEntity(new UrlEncodedFormEntity(bodyParams, HTTP.UTF_8)); HttpHost httpHost = new HttpHost(&lt;your host here&gt;); HttpResponse response = defaultHttpClient.execute(httpHost, request); HttpEntity entity = response.getEntity(); String content = EntityUtils.toString(entity); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload