Skip to content

Commit 67d0e90

Browse files
author
unknown
committed
对其中几个方法补充HttpContent参数
1 parent f19f881 commit 67d0e90

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/main/java/com/tgb/ccl/http/httpclient/HttpClientUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public static String fmt2String(HttpResponse resp, String encoding) throws HttpP
403403
EntityUtils.consume(resp.getEntity());
404404
} catch (ParseException | IOException e) {
405405
throw new HttpProcessException(e);
406-
}finally{
406+
}finally{
407407
close(resp);
408408
}
409409
return body;

src/test/java/com/tgb/ccl/http/TestCookieWithHttpCookies.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.regex.Pattern;
99

1010
import org.apache.http.Header;
11+
import org.apache.http.cookie.Cookie;
1112

1213
import com.tgb.ccl.http.common.HttpConfig;
1314
import com.tgb.ccl.http.common.HttpCookies;
@@ -65,9 +66,9 @@ public static void main(String[] args) throws HttpProcessException {
6566
System.out.println("----登录成功----");
6667

6768
// //打印参数,可以看到cookie里已经有值了。
68-
// for (Cookie cookie : cookies.getCookieStore().getCookies()) {
69-
// System.out.println(cookie.getName()+"--"+cookie.getValue());
70-
// }
69+
for (Cookie cookie : cookies.getCookieStore().getCookies()) {
70+
System.out.println(cookie.getName()+"--"+cookie.getValue());
71+
}
7172

7273
//访问积分管理页面
7374
Header[] headers = HttpHeader.custom().userAgent("User-Agent: Mozilla/5.0").build();

0 commit comments

Comments
 (0)