Extract Cookie from Web Response in Xamarin.Forms

FirmuFirmu Member ✭✭

How can we get cookie from the response header? Is there any way to get cookie other than from web response.
For me web response cookie count is 0.

WebResponse webResponse = request.GetResponse();
CookieContainer cookie = request.CookieContainer; // here cookie is null

Please help.

Best Answer

  • FirmuFirmu ✭✭
    Accepted Answer

    I found the answer and would like to share here.
    var cookie = webResponse.Headers.Get("Set-Cookie");

Answers

  • FirmuFirmu Member ✭✭
    Accepted Answer

    I found the answer and would like to share here.
    var cookie = webResponse.Headers.Get("Set-Cookie");

Sign In or Register to comment.