0

So I was looking for an answer and everything I've looked for hasn't worked.

I'm using WinForms with .NET Framework 4.8

I'm very confused as to this. Anyone able to help? Code below is just an example of what I need it to be used with.

WebClient client = new WebClient();
client.DownloadString("https://example.com");

Let's assume that the cookie's name is "USERID" and the ID is "HA-49"

  • 3
    Does this answer your question? [Using CookieContainer with WebClient class](https://stackoverflow.com/questions/1777221/using-cookiecontainer-with-webclient-class). So something as simple as `client.Headers.Add(HttpRequestHeader.Cookie,"USERID=HA-49");` – Trevor Oct 28 '20 at 12:29
  • 1
    This is perfect, thanks so much! – Party Parrot Oct 28 '20 at 12:36

1 Answers1

1

As Çöđěxěŕ said.

client.Headers.Add(HttpRequestHeader.Cookie,"USERID=HA-49");

This indeed works.