如何在 HTTP Builder 0.5.0/HTTPClient 中保存 cookie
我正在尝试按照此处的说明进行操作: http://www.innovation.ch/java/HTTPClient/advanced_info.html
但是,如果我使用 HTTP Builder,以下几行
System.setProperty("HTTPClient.cookies.save","true")
System.setProperty("HTTPClient.cookies.jar","/home/misha/.httpclient_cookies")
似乎不会创建文件:
~/.httpclient_cookies
当弄清楚时,我将一如既往地发布解决方案。
:)
米莎
I am trying per instructions here:
http://www.innovation.ch/java/HTTPClient/advanced_info.html
However, if I am using HTTP Builder, the following lines
System.setProperty("HTTPClient.cookies.save","true")
System.setProperty("HTTPClient.cookies.jar","/home/misha/.httpclient_cookies")
do not seem to create a file:
~/.httpclient_cookies
I will post a solution as always when figure it out.
:)
Misha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您链接的 HTTPClient 与与 groovy HTTPBuilder 捆绑在一起的 apache HTTPClient 不同。查看此文档以使用Apache HTTPClient。
The HTTPClient you've linked is not the same as the apache HTTPClient that's bundled with the groovy HTTPBuilder. Take a look at this documentation for persisting cookies with apache HTTPClient.
谢谢。我采用了一个更黑客的解决方案
......
:
Thank you. I went with a hackier solution:
...
...