插件开发工具库,推荐依赖该工具库。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
743 B

package com.fanruan.api.net.http;
import com.fr.third.org.apache.http.HttpEntity;
import com.fr.third.org.apache.http.ParseException;
import com.fr.third.org.apache.http.util.EntityUtils;
import java.io.IOException;
public class EntityKit {
/**
* 利用defaultCharset字符集将HttpEntity对象转化为String对象
* @param entity 需要转化为String的HttpEntity对象
* @param defaultCharset 传入的字符集
* @return HttpEntity对象转化为的String对象
* @throws IOException
* @throws ParseException
*/
public static String toString(HttpEntity entity, String defaultCharset) throws IOException, ParseException {
return EntityUtils.toString(entity, defaultCharset);
}
}