码迷,mamicode.com
首页 > 其他好文 > 详细

HttpClient3.1设置header信息

时间:2014-09-24 12:41:16      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   os   ar   for   div   

     HttpClient client = new HttpClient();
        GetMethod get = new GetMethod(URL);
        get.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
        get.setRequestHeader("Authorization", base64_auth_string);
        get.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, "UTF-8");  
        
       对于PostMethod设置方式与GetMethod方式一样。

 

HttpClient3.1设置header信息

标签:style   blog   http   color   io   os   ar   for   div   

原文地址:http://www.cnblogs.com/yshyee/p/3990220.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!