httpwebrequest 标头中多个 Set-Cookie 的问题
我尝试使用 C# HTTPWebRequest
类登录 amazon.com,我可以登录,但无法读取标头中的多个 set-cookies
当服务器响应多个“Set-Cookie:”标头时,只有 可供我
第一个在标头HTTPWebRequest 中的 Web 响应 中
Set-Cookie: x-main=Yvi4723B?Nk5zuPPCZ0?66eGEI5kVnOM; path=/; domain=.amazon.com;
expires=Wed May 25 13:20:05 2011 GMT
使用 如何使用 HTTPWebRequest
类获取标头中的所有“Set-Cookie:”?
HTTP Live 标头中的 Web 响应
Set-Cookie: x-main=Yvi4723B?Nk5zuPPCZ0?66eGEI5kVnOM; path=/; domain=.amazon.com;
expires=Wed May 25 13:20:05 2011 GMT
Set-Cookie:atmain=4|WzNBbofyvkTvUaivgd9aS0Tzy0V2MJoUy+gJVcZ4szMhpt+gEyrRyLfUEodtZBKdn9vyJQJ3szoLgO12SUrB5XYqJ/tggOPurUepz5qsd6eg2V6vfbE0X1HQKp03xVkYLPEH5MDhmkMevQgkv36FyY+zA6HN5LzlM92+4kGu6wHeIILZ5+y/dtoYU/uORs1hC9hEo5iwP8Mljg4hDx7b/g==; path=/; domain=.amazon.com; expires=Wed May 25 13:20:05 2011 GMT; secure
Set-Cookie: ubid-main=182-3549292-6045052; path=/; domain=.amazon.com; expires=Wed May 25 13:20:05 2011 GMT
我期待您的回复,
提前致谢......
I try to login amazon.com using C# HTTPWebRequest
class, i can login but not able to read multiple set-cookies in header
When the server responds with multiple "Set-Cookie:"-headers, only the first one becomes available to me in header
Web Response in HTTPWebRequest
Set-Cookie: x-main=Yvi4723B?Nk5zuPPCZ0?66eGEI5kVnOM; path=/; domain=.amazon.com;
expires=Wed May 25 13:20:05 2011 GMT
How to get all "Set-Cookie:" in header using HTTPWebRequest
class??
Web Response in HTTP Live Header
Set-Cookie: x-main=Yvi4723B?Nk5zuPPCZ0?66eGEI5kVnOM; path=/; domain=.amazon.com;
expires=Wed May 25 13:20:05 2011 GMT
Set-Cookie:atmain=4|WzNBbofyvkTvUaivgd9aS0Tzy0V2MJoUy+gJVcZ4szMhpt+gEyrRyLfUEodtZBKdn9vyJQJ3szoLgO12SUrB5XYqJ/tggOPurUepz5qsd6eg2V6vfbE0X1HQKp03xVkYLPEH5MDhmkMevQgkv36FyY+zA6HN5LzlM92+4kGu6wHeIILZ5+y/dtoYU/uORs1hC9hEo5iwP8Mljg4hDx7b/g==; path=/; domain=.amazon.com; expires=Wed May 25 13:20:05 2011 GMT; secure
Set-Cookie: ubid-main=182-3549292-6045052; path=/; domain=.amazon.com; expires=Wed May 25 13:20:05 2011 GMT
I am looking forward your reply,
Thanks in advance.......
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您的意思是在 HttpWebResponse 对象中获取 Set-Cookie 标头;如果是这样,那么您可以使用 GetValues 方法来获取所有Set-Cookie 标头的实例。
I think you mean to get the Set-Cookie headers in the HttpWebResponse object; if so, then you can use the GetValues method to get the all the instances of the Set-Cookie header.