The Android client will send a request to the server.
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://test.com/test");
HttpResponse response = httpclient.execute(httppost);
and then received a response from the server as shown below
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Wed, 26 Sep 2012 10:59:35 GMT
Content-Type: multipart/form-data; type="image/jpeg"; boundary="simple_boundary"; start="<image>"; start-info="image/jpeg"
Transfer-Encoding: chunked
2000
Content-Type: image/jpeg
Content-Transfer-Encoding: binary
Content-ID: <image>
......JPEG Binary Code Here.....
How can I get an image (binary) from an answer.
InputStream is = response.getEntity().getContent();
(InputStream) also contains border and content information.
--simple_boundary
Content-Type: image/jpeg
Content-Transfer-Encoding: binary
Content-ID: <image>
......JPEG Binary Code Here.....
--simple_boundary
How can I get pure binary image data. And is that possible?
source
share