HttpWebRequest

N

Nissim

Thanks again ...
i'm sorry, May be my problem was not explained properly.
i need to read from console app several HTML content.
i know how to do that with HttpWebRequest and
HttpWebResponse , and its work .
the problem is that every page i read is a new session in
the web server.
i want to read all the 100 html pages in only one session.
is that possible?
Thanks
Nissim
 
M

Martin Honnen

Nissim wrote:

i need to read from console app several HTML content.
i know how to do that with HttpWebRequest and
HttpWebResponse , and its work .
the problem is that every page i read is a new session in
the web server.
i want to read all the 100 html pages in only one session.
is that possible?

I think the answers you have already got suggest that you need to use
the CookieContainer of the first HttpWebResponse with all following
HttpWebRequests. Have you tried that?
Usually a web server application keeps track of sessions by sending out
a cookie with the session id and the client sends that sesssion id
cookie back. Thus if you use the CookieContainer containing the session
id cookie the server sends back on the first request then all your
following requests should be in the same session.
 
F

Feroze [MSFT]

What exactly do you mean by "Session" ? Do you mean application sessions
(implemented using cookies for example) or TCP connection sessions ?

If former, use CookieContainer as the other posters have suggested.

If latter, you should be using KeepAlive=true on the webrequest ( which is
the default). One of the reasons that you are not seeing this default
behavior could be that you are using Windows Integrated Authentication on
the server. Is that the case ?

feroze.

--
Remove "user" from the email address to reply to the author.

This posting is provided "AS IS" with no warranties, and confers no rights

Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top