java - Is executing an httpclient that contains both a StringEntity and appended query parameters disallowed? -


I do not know if executing in a httpclient both contains stringent and apeted query parameters or if something is fundamentally this code With the wrong / my perception that what is this doing?

This is the same, this is what I think is to do / what I am trying to do:

Attach the parameter that is the method for logic within the URL Has been passed. IOW, serNum and siteNum should end in the URL such as:

  http: //10.0.2.228642.api/DeliveryItems/PostArgsAndXMLFileAsStr?serNum=Bla&siteNum=Bla  

I have a large AGG which I want to pass within the body of httppost, though - not within the URL.

Personal Class Post Delivery item task Extends Async Task {{/ p>

  @ Override protected string doInBackground (string ... parameter) {string result = ""; String Stratted XML = Param [0]; String Serum = Param [1]; String Sethanum = Param [2]; Uri. Builder Builder = New Uri. Builder (); Builder.scheme ("http"). Authority ("10.0.2.2:28642"). AppendPath ("API"). AppendPath ("DeliveryItems"). AppendPath ("PostArgsAndXMLFileAsStr"). Appendukquemater ("serial number", serNum) .appendQueryParameter ("Schneman", Schneman); String URLToCall = builder.build (). ToString (); Try {StringEntity = New String (stringifiedXML); HTTP Client HTTP Client = New DefaultHttpClient (); HttpPost httppost = New HttpPost (URLToCall); Httppost.setEntity (se); HttpResponse response = httpclient.execute (httppost); // & lt; = Pears-shaped result = response.toString (); } Grip (Client Protocol E) {Log.e ("Client Protopol Exception", E.Oustustring ()); } Hold (unsupported encoding exception uex) {Log.e ("unsupported encoding exception", uex.toString ()); } Hold (IOException iox) {Log.e ("IOException", iox.toString ()); } If (tap! = Result) return result; }  

It seems as long as I do not go to this line, all take good steps:

  HTTPRSpace response = httpclient .execute (httppost);  

... where rubber actually meets silicon - Vaamo! It dies a quick death, disappears in the sky like the Basque Riviera dog. Is this URL due to the mixing and matching of RRG and StringType? Or ??? The "SetInty" line does not complain, so I suspect that, but ... What could be the problem? LogCat does not give me any errors - the app just croaks

UPDATE

When it "just croaks," it ends between these two lines in AsyncTask.class:

  Public Ascend Tasks ( ) {/ * Collected Code * /} Public Ultimate Android OS.AyncTask.Status GetStatus () {/ * Compiled Code * /}  

Update 2

The tutorial delimiter suggested: " A different HTTP client Try to use either HttpURLConnection or something else. "

But how?

With this:

  HTTP client httpclient = new HTTPPLL connection ();  

I'm getting, " error: HTTPRUA connection is abstract, can not be done immediately "

with it:

  httpPL Connection connection httpclient = new DefaultHttpClient ();  

... There is no ".execute ()" method available for the httpclient; And it is also for the same:

  HTTP Connection Connection httpclient = New HttpURLConnection ();  

... such ... ???


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -