this is my client side code where i have made json object in the json object i have put byte[] and two string i just converted the bitmap to byte[] and i have receive it on the servlet i using httppost i am trying to send that json data.how can i receive the byte[] and two strings and then i have to show it on the browser and the two strings.
public void getServerData(byte[] img, String name, String gender)throws JSONException, ClientProtocolException, IOException {
ArrayList<String> stringData = new ArrayList<String>();
DefaultHttpClient httpClient = new DefaultHttpClient();
ResponseHandler<String> resonseHandler = new BasicResponseHandler();
HttpPost postMethod = new HttpPost(SERVER_URL);
postMethod.setHeader("Content-Type", "application/json");
JSONObject json = new JSONObject("mydata");
json.put("image", img);
json.put("name", name);
json.put("gender", gender);
postMethod.setEntity(new ByteArrayEntity(json.toString().getBytes(
"UTF8")));
String response = httpClient.execute(postMethod, resonseHandler);
Log.e("response :", response);
}
the int doGet(request,response){}
i have to receive it.