You need to put image data in byte by using multipart form data.
try {
HttpPost httppost = new HttpPost("some url");
MultipartEntity multipartEntity =
new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
multipartEntity.addPart("Image", new FileBody(image));
httppost.setEntity(multipartEntity);
mHttpClient.execute(httppost, new YOURHANDLER());
} catch (Exception e) {
Log.e(ServerCommunication.class.getName(), e.getLocalizedMessage(), e);
}
To send post request using parameters
HttpPost httpPost = new HttpPost(url);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
if (values != null) {
for (Map.Entry<String, String> entry : values.entrySet()) {
nameValuePairs.add(
new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));
}