コード例 #1
0
  public static HttpEntity getEntityFromJSON(JSONObject json) {
    HttpEntity entity = null;

    try {
      entity = new ApacheHttpJSONEntity(json);
    } catch (UnsupportedEncodingException e) {
      ApacheHttpWrapperLog.e("Error while creating json entity: " + e.toString());
    }

    return entity;
  }
コード例 #2
0
  public static HttpEntity getEntityFromString(String str) {
    HttpEntity entity = null;

    try {
      entity = new StringEntity(str, "UTF8");
    } catch (UnsupportedEncodingException e) {
      ApacheHttpWrapperLog.e("Error while creating string entity: " + e.toString());
    }

    return entity;
  }