Java 似乎无法对我的apache http客户端解析具有到期格式Mon,2017年9月25日13:40:02 GMT的Set Cookie
具有以下格式的到期日期的Cookie:Java 似乎无法对我的apache http客户端解析具有到期格式Mon,2017年9月25日13:40:02 GMT的Set Cookie,java,apache,http,cookies,apache-httpclient-4.x,Java,Apache,Http,Cookies,Apache Httpclient 4.x,具有以下格式的到期日期的Cookie: Thu, 01-Jan-1970 00:00:01 GMT (please note - the dashes which are present in the date string here) - yes, these cookies DO PARSE FINE, but when a cookie with an expiration date for example: Mon, 25 Sep 2017 13:40:02 GMT (note
Thu, 01-Jan-1970 00:00:01 GMT (please note - the dashes which are present in the date string here) - yes, these cookies DO PARSE FINE, but when a cookie with an expiration date for example:
Mon, 25 Sep 2017 13:40:02 GMT (note - no dashes present in the date string) is received - fails to be parsed by the client.
对于它们,客户端显示以下警告,并且根本不解析它们。随后,在从页面接收的cookie列表中根本找不到它们。这里是客户端为“没有破折号的cookie”显示的警告消息
警告:
如果还不够清楚:我的问题是:我能在ApacheHTTP客户端中解决这个问题而不编写自己的集Cookie头解析器吗
还是这是个问题
有人知道吗,谢谢?我通过添加
.setCookieSpec(CookieSpecs.STANDARD)
到RequestConfig对象
.setCookieSpec(CookieSpecs.STANDARD)