请注意:第一个链接指向曾经在HttpClient V3中工作的内容。在下面找到与V4相关的信息。
这应该回答你的问题
http://www.java2s.com/Code/Java/Apache-
Common/Getcookievalueandsetcookievalue.htm
以下与V4有关:
…此外,javadocs还应包含有关cookie处理的更多信息
http://hc.apache.org/httpcomponents-client-
ga/httpclient/apidocs/index.html
这是httpclient v4的教程:
http://hc.apache.org/httpcomponents-client-
ga/tutorial/html/index.html
这是一些有用的伪代码(我希望,它仅基于文档):
HttpClient httpClient = new DefaultHttpClient();// execute get/post/put or whateverhttpClient.doGetPostPutOrWhatever();// get cookieStorecookieStore cookieStore = httpClient.getcookieStore();// get cookiesList<cookie> cookies = cookieStore.getcookies();// process...
请确保您阅读了ResponseProcesscookies和AbstractHttpClient的javadocs。



