ntity(params,"utf-8"));Р CloseableHttpResponse response = httpClient.execute(post);Р String result = EntityUtils.toString(response.getEntity());Р response.close();Р httpClient.close();РGET请求:Р public void doGetWithParam() throws Exception{Р CloseableHttpClient httpClient = HttpClients.createDefault();Р URIBuilder uriBuilder = new Р URIBuilder("");Р uriBuilder.addParameter("query", "花千骨");Р HttpGet get = new HttpGet(uriBuilder.build());Р CloseableHttpResponse response = httpClient.execute(get);Р int statusCode = response.getStatusLine().getStatusCode();Р HttpEntity entity = response.getEntity();Р String string = EntityUtils.toString(entity, "utf-8");Р response.close();Р httpClient.close();Р}РCookie简介РCookie概念:由服务器端产生,存放于客户端浏览器的文本文件。РCookie原理:Р1) 在服务器端实例化Cookie对象,里面只能存放字符串内容(Cookie尽量不要存放中文)。