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; }
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; }