C
C
CityzenUNDEAD2020-11-15 19:18:11
Parsing
CityzenUNDEAD, 2020-11-15 19:18:11

How to correctly write a request to the site and read the response cookies?

Hello everyone!
I'm trying to implement a seemingly not complicated procedure, make a request to the site and read the response cookies from this site. I have been learning C# for only a couple of months, and now I finally decided to start writing something in it.
I'm trying to use the HttpClient class for the request, and HttpResponseHeaders to read the headers. In the dock to the HttpResponseHeaders class there is a description of how to receive certain headers, but nothing about cookies. They have their own classes, such as Cookie and CookieCollection, and they also have CookieContainer.
I'm most confused. How to connect all this so that when you request to read the response cookies? Do I need to read a line from the header and cast it to the Cookie type or what?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question