Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   HttpWebRequest (http://www.velocityreviews.com/forums/t782462-httpwebrequest.html)

Nissim 01-04-2004 04:37 AM

HttpWebRequest
 
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

Martin Honnen 01-04-2004 11:30 AM

Re: HttpWebRequest
 


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.

--

Martin Honnen
http://JavaScript.FAQTs.com/


Feroze [MSFT] 01-07-2004 04:57 AM

Re: HttpWebRequest
 
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




"Martin Honnen" <Martin.Honnen@t-online.de> wrote in message
news:#74nfYr0DHA.1336@TK2MSFTNGP12.phx.gbl...
>
>
> 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.
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/
>





All times are GMT. The time now is 09:07 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.