I have code for POST query on Java
ArrayList<HashMap<String, String>> books=SQLiteDbWrapper.getInstance().getAllBooks();
JSONObject object=new JSONObject();
object.put("key", KEY);
JSONArray isbns=new JSONArray();
for (HashMap<String, String> book:books) {
isbns.put(book.get(SQLiteDbHelper.ISBN13_FIELD));
}
object.put("isbns", isbns);
object.put("email", email);
Log.e("log", object.toString());
HttpClient client = new DefaultHttpClient();
HttpPost request = new HttpPost(BASE_URL+SUBMIT_SCRIPT);
request.setEntity(new ByteArrayEntity(
object.toString().getBytes("UTF8")));
HttpResponse response = client.execute(request);
I need to send JSON data into server; my web-service must get this data from $POST['json'] variable, but I don't know how can I put my JSONObject object into 'json' field for POST query? Please, help me