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方式一样。
时间: 2024-10-07 15:26:51