Reuse Connection with HttpWebRequest in C#

后端 未结 2 358
感动是毒
感动是毒 2021-01-15 00:47

I need to make a POST request using .Net.

I can authenticate by GET, and so I’m trying to make a POST request on the same connection to keep my authentication.

2条回答
  •  隐瞒了意图╮
    2021-01-15 01:45

    Any idea how the authentication is managed on the other end? IE. If it sets a cookie, then you need to make sure you account for that, see this page, and specifically this note:

    Note

    For security reasons, cookies are disabled by default. If you want to use cookies, use the CookieContainer property to enable cookies.

提交回复
热议问题