android - How to send HTTP POST request and receive response? -


I'm going to create a mobile application that works with Pro CommuniGate Server.

For example, I need to create the following Android client C - CGP server s dialog and get XIMSS.nonce Node value:

  c: received / ximsslogin / HTTP / 1.1 host: myserver.com content type: text / xml content-length: from 42 & lt; XIMSS & gt; & Lt; ListFeatures id = "list" /> & Lt; XIMSS & gt; S: HTTP / 1.1 200 OK Content-Length: 231 Connection: Live-Stay Content Type: text / xml; Charset = utf-8 server: communiGatePro / 5.3 & lt; XIMSS & gt; & Lt; Temporarily & gt; 2C3E575E5498CE63574D40F18D00C873 & lt; / Temporarily & gt; & Lt; Language & gt; German & lt; / Language & gt; & Lt; Feedback id = "s" /> & Lt; / XIMSS & gt;  

Example, in action script 3.0 it looks like this:

  var loader: loader = new loader (); Loader.addEventListener (event.complete, full handler); Var urlRequest: URLRequest = new URLRequest (...); UrlRequest.method = ...; UrlRequest.data = ...; Loader.load (URLRequest); Private Function Full Handler (...): Zero {...};  

How to Android 2.1 ?

After

Schnapple says your question looks very broad and confusing in reading and understanding is.

Here are some common codes to send and receive feedback from a HTTP POST server that may be helpful though.


  public string postpage (string url, file data, boolean return adder) {rate = null; HttpClient.getParams () SetParameter (Client PNames.COOKIE_POLICY, CookiePolicy.RFC_2109); HttpPost = New HTTP Post (URL); Reaction = null; FileTypeTMP = Faucet; TMP = new filetyt (data, "UTF-8"); HttpPost.setEntity (tmp); Try {response = httpClient.execute (httpPost, localContext); } Catch (ClientProtocolException E) {System.out.println ("HTTPHelp: ClientProtocolException:" + e); } Hold (IOException e) {System.out.println ("HTTPHelp: IOException:" + e); } Ret = response.getStatusLine () ToString (); Return writ; }  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -