code: public static ServerRequest fromJSON(JSONObject json, Context context) {
          JSONObject post = null;
          String requestPath = "";
          try {
              if (json.has(POST_KEY)) {
                  post = json.getJSONObject(POST_KEY);
              }
          } catch (JSONException e) {
              // it's OK for post to be null
          }
          
          try {
              if (json.has(POST_PATH_KEY)) {
                  requestPath = json.getString(POST_PATH_KEY);
              }
          } catch (JSONException e) {
              // it's OK for post to be null
          }
          
          if (requestPath != null && requestPath.length() > 0) {
              return getExtendedServerRequest(requestPath, post, context);
          }
          return null;
      }
docs: <p>Converts a {@link JSONObject} object containing keys stored as key-value pairs into
  a {@link ServerRequest}.</p>
  
  @param json    A {@link JSONObject} object containing post data stored as key-value pairs
  @param context Application context.
  @return A {@link ServerRequest} object with the {@link #POST_KEY}
  values set if not null; this can be one or the other. If both values in the
  supplied {@link JSONObject} are null, null is returned instead of an object.