restsharp - no cookie in response object

混江龙づ霸主 提交于 2019-12-04 11:54:05

I had the same problem, your server sends you a cookie with HTTPonly=true parameter, you should change HTTOnly parameter to false and then you can grab the cookie from token response.

see this link answer to your question

VeYroN

Thanks @KarthikNishanth. To make it clear:

client.CookieContainer = new CookieContainer ();
var cookie = client.CookieContainer.GetCookieHeader(new Uri("http://domain_or_subdomain.ext"));

var client is a RestClient

After the client.Execute(request); the GetCookieHeader() will return the desired cookie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!