HttpPost Iphone Versus Android?

You're not constrained to UrlEncodedFormEntity check out the "Known Indirect Subclasses" of the org.apache.http. HttpEntity interface (at the top of the page).

You're not constrained to UrlEncodedFormEntity, check out the "Known Indirect Subclasses" of the org.apache.http. HttpEntity interface (at the top of the page). The most commonly used ones are probably: ByteArrayEntity: An entity whose content is retrieved from a byte array.

FileEntity: An entity whose content is retrieved from a file. InputStreamEntity: A streamed entity obtaining content from an InputStream. SerializableEntity: Takes an Serializable object and outputs its serialized form StringEntity: An entity whose content is retrieved from a string.

And finally UrlEncodedFormEntity: An entity composed of a list of url-encoded pairs. (this list is not complete, check out the above link) Here's some examples of how to use different types of entities: HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(address); // a string entity containing JSON: post. SetEntity(new StringEntity("{ \"actually\" : \"json\", \"this time\"}"); // or uploading an image file: post.

SetEntity(new FileEntity(new File("some/local/image. Png"), "image/png"); // or some random bytes: byte randomBytes = new byte128; new Random(). NextBytes(randomBytes); post.

SetEntity(new ByteArrayEntity(randomBytes); HttpResponse response = client. Execute(post); ... Of course, don't do this all at once, one call to setEntity() only! If you need MIME multipart requests, check out this tutorial by Vikas Patel (you'll need an updated Apache HTTP Client JAR).

Judging from the date of the above tutorial, it should be safe to use "HttpClient 4.1.2 (GA)" now, not some beta release. – Philipp Reichart Sep 30 at 17:36.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions