code: public static JSONObject getJSONObject(HttpPost request, Integer method, HashMap<String, String> params) throws JSONException {
          switch (method) {
          case METHOD_PUT:
          case METHOD_DELETE:
          case METHOD_POST:
              return doPostRequest(request, params);
          default:
              throw new RuntimeException("Wrong http method requested");
          }
      }
docs: Get JSON response for POST
  
  @param   request Request object for POST
  @param   method HTTP method
  @param   params POST parameters
  @throws  JSONException
  @return  {@link JSONObject}