HttpRequestHeader cookie format

前端 未结 3 1053
旧时难觅i
旧时难觅i 2020-12-11 04:20

In which format does HttpRequestHeader.Cookies need to be specified? F.e, if I want to add cookie named CITY with value NY how should I do that with WebClient.Headers.Add()

3条回答
  •  -上瘾入骨i
    2020-12-11 05:13

    Headers.Add:

     myWebHeaderCollection.Add("CITY","NY");
    

    Here is how your Cookie header should look like at the end rfc 6265:

    Cookie: CITY=NY;
    

提交回复
热议问题