HttpClient3.1设置header信息

     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方式一样。
上一篇:Python基础第五天


下一篇:hadoop_spark伪分布式实验环境搭建和运行实例详细教程