public static String doPostStr(String httpUrl, String str) {
HttpPost httpPost = null;
try {
HttpClient client = getHttpClient();
httpPost = new HttpPost(httpUrl);
StringEntity entity = new StringEntity(str);
entity.setContentType("application/x-www-form-urlencoded");
entity.setContentEncoding("utf-8"); httpPost.setEntity(entity); HttpResponse response = client.execute(httpPost);
String result = EntityUtils.toString(response.getEntity(), DEFAULT_CHARSET);
return result;
} catch (Exception e) {
logger.error("http post is error," + e.getMessage(), e.fillInStackTrace());
} finally {
httpPost.releaseConnection();
}
return null;
}

最新文章

  1. 23种oop设计模式定义
  2. RedHat Enterprise Linux 7关闭防火墙方法
  3. Android常用抓包工具之TcpDump
  4. 常见HTTP状态基本解释
  5. LINUX 下通过lsof恢复被误删除的文件
  6. oracle 10g 学习之服务器端安装(1)
  7. .NET Framework Execution Was Aborted By Escalation Policy
  8. (转)在网页中JS函数自动执行常用三种方法
  9. springmvc中forward和redirect
  10. Poj 2707 Copier Reduction
  11. [C++ 2011 STL (VS2012 Update4) 源代码阅读系列(2)]熟悉一些宏定义和模版偏特化或叫模版专门化
  12. node多版本管理--nvmw
  13. Unity 游戏框架搭建 (二十) 更安全的对象池
  14. php 运行的四种模式
  15. jQuery 属性操作方法(五)
  16. Function方法和属性图
  17. 51NOD 1705 七星剑 [DP 期望的线性性质]
  18. [软件研究]对AMH面板的研究
  19. IBM MQ相关 ---- 系列文章
  20. java8时间操作

热门文章

  1. 设计模式之Singleton模式
  2. Win32 配置文件用法
  3. Ubentu下安装Docker
  4. LayoutInflater的动态增加控件
  5. 需求用例分析之五:业务用例之Rational系
  6. centos7编译安装Python3.6(与2.7并存)
  7. php注册审查
  8. [Windows Powershell]-学习笔记(4)
  9. XDU 1164 男神的树(树+lazy数组)
  10. 300. Longest Increasing Subsequence(LIS最长递增子序列 动态规划)