private static String receiveFromHttpBackEnd(String url, String json) throws IOException, JSONException {
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
String USER_AGENT = "Mozilla/5.0";
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
con.setRequestProperty("Content-Type", "application/json");
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(json);
wr.flush();
wr.close();
return getResponse(con.getInputStream());
}