M
M
martensit2018-07-12 01:00:46
C++ / C#
martensit, 2018-07-12 01:00:46

How to get specific HttpWebRequest response header in c#?

HttpWebResponse response1 = (HttpWebResponse)req1.GetResponse();
StreamReader reader1 = new StreamReader(response1.GetResponseStream());
File.WriteAllText(@"C:\result.txt", reader1.ReadToEnd());

This only returns the body of the response.
I need to get the value of the "Location" and "Set-Cookie" headers

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-07-12
@martensit

the meaning of the headings

Cookies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question