如何在 winhttp 中检索特定站点和路径的 cookie
我想根据我要向其发送请求的特定主机和路径检索存储在 winhttp 会话缓存中的 cookie。我想在发送请求之前检索这些 cookie,所以我还没有请求句柄,我所拥有的只是会话和连接句柄,当然还有我要向其发送请求的路径和主机。
换句话说,我想在实际发送请求之前检索 winhttp 将发送到服务器的 cookie。
我问的原因是因为我们的服务器检查一个特定的标头,我必须设置该标头,以匹配基于 cookie 等的 md5 检查。我无法控制服务器代码或任何东西。
干杯,
I would like to retrieve the cookies stored in the winhttp session cache based upon a specific host and path that I am about to send a request to. I want to retrieve those cookies before I send the request, so I don't have the request handle yet, all I have is the session and connection handles and of course the path and host I'm going to send the request to.
In other words I would like to retrieve the cookies that winhttp will send to the server before I actually send the request.
Reason I'm asking is because our server checks a specific header, which I have to set, to match an md5 check based upon, amongst other, the cookies. I don't have control over the server code or anything.
Cheers,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 WINHTTP_CALLBACK_STATUS_SENDING_REQUEST 通知作为检查 winhttp 默认情况下放在请求上的 cookie 标头的机会,然后在从回调返回之前添加 md5 标头。
Use the WINHTTP_CALLBACK_STATUS_SENDING_REQUEST notification as a chance to inspect the cookie headers winhttp put by default on the request and then add the md5 header before returning from the callback.