全文预览

基于java的网上商城设计与实现--毕业论文(设计)

上传者:非学无以广才 |  格式:doc  |  页数:45 |  大小:1150KB

文档介绍
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尽量不要存放中文)。

收藏

分享

举报
下载此文档