Java:HttpClient 中的自动 cookie 处理?
在 Java HttpClient 功能列表中,它表示:
自动 Cookie 处理以供读取 Set-Cookie:来自服务器的标头 并将它们通过 Cookie 发回: 适当时标头。
但我不知道如何使用这个功能。我只需要打开一个网页,让它设置所有 cookie,然后使用收到的 cookie 刷新同一页面。
谢谢。
In Java HttpClient feature list it says:
Automatic Cookie handling for reading
Set-Cookie: headers from the server
and sending them back out in a Cookie:
header when appropriate.
But I can't figure out how to use this feature. I just need to open a web page, let it set all the cookies, then refresh the same page with received cookies.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不断从服务器返回错误,说我的客户端不支持 cookie,我应该打开它们。以下行停止了这些错误。希望这对你有用。
I kept getting errors back from the server saying my client didn't support cookies and I should turn them on. The following line stopped those errors. Hope this works for you.