HttpWebRequest and Set-Cookie header in response not parsed (WP7)

后端 未结 4 677
借酒劲吻你
借酒劲吻你 2021-01-06 02:41

I am trying to get the header \"Set-Cookie\" or access the cookie container, but the Set-Cookie header is not available. The cookie is in the response header, but it\'s not

4条回答
  •  半阙折子戏
    2021-01-06 02:57

    You must edit the headers collection directly. Something like this:

    request.Headers["Set-Cookie"] = "name=value";
    
    request.BeginGetResponse(myCallback, request);
    

提交回复
热议问题