473,657 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpWebRequest. KeepAlive property

Hi,

I can't send 'Connection: Keep-Alive' property in the second connection
of my HttpWebRequest. Suppose:
HttpWebRequest hreq = .....
hreq.KeepAlive = true;
HttpWebResponse hresp = GetResp()....

------
here, it's OK, when i analyse packets with ethereal, I see 'Connection:
Keep-Alive. Then comes the seconde connection
-------

hreq = .....
hreq.KeepAlive = true;

-------
this time hreq.Method = "POST", and whatever I do, I can't manage to set
KeepAlive property. Interestingly enough, when I debug, KeepAlive is
always true, but there is no Connection: Keep-Alive line in the headers
sent to server...

Any help?

Thanks
Nov 16 '05 #1
0 1552

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1829
by: Gil Strauss | last post by:
When using .net framework HttpWebRequest object, how can we set the connection header to "keep-alive" Acording to Microsoft ducomentation, setting the keepAlive property to true, should do the job, but it doesn't seem to do so When trying to change the header manually (using httpWebRequestObject.Connection = "Keep-Alive") we get the following error Argument Exception: "Keep-Alive and Close may not be set with this property. We try the...
1
9326
by: Cliff Harris | last post by:
I am trying to automate a series of form posts on a website. This site requires that my session be kept alive through successive posts (it basically tracks me by a sessionid, and if I get a new connection each time, I get a new sessionid). An HttpWebRequest object has a KeepAlive property that is, by default, set to true. I have been unsuccessful in finding adequate documentation about this. Most people seem to not want to keep the...
3
7866
by: Dan | last post by:
I'm experimenting with HttpWebRequest. After I've created a request: m_request = (HttpWebRequest) WebRequest.Create(uri); I'd like to repeatedly send requests to the URI, as follows: public void SendRequest(string body) { StreamWriter stream = new StreamWriter(m_request.GetRequestStream(),Encoding.ASCII);
0
2567
by: joshblair | last post by:
Hello, I am trying to post XML documents to a third party using the HttpWebRequest. This URL uses HTTPS (SSL) but I don't have a client certificate to deal with. Apparently they are using WebMethods as the platform that receives these postings. I don't have any experience with that technology. The sample below is the from test app that I put together to post the XML (cXML Order Requests) documents. These documents, at least my
1
2699
by: Stumped | last post by:
I'm trying to remotely logon to a website however I'm experiencing a view state problem, due to there being a web cluster in place. I currently create an HttpWebRequest to GET login page, I then obtain the ViewState and EventValidation values from the response and then create another HttpWebRequest to POST those back with my login details. The problem is I can't be sure I'll be posting back to the same box that provided me with the ViewState...
1
1446
by: kellox | last post by:
I'm implementing a propiertary protocol for a company which is actually an extension of HTTP (extended with some specific headers). If I use the .NET class HttpWebRequest and HttpWebResponse respectively I can easily communicate with the server by setting the necessary headers. Since any further requests/responses should be sent over the connection, established after the first request, for receiving events from the server, I have to left the...
8
4761
by: gerbrandc | last post by:
Hello, I hope somebody has a good explanation for this issue. Okay I'm having troubles with the httpWebRequest method. I need to download reports from a specified server (can't give these details). Now I don't have trouble with an "HTTPS" url but I with an "HTTP" url I get the error : error: The server committed a protocol violation. Section=ResponseHeader Detail=Header name is invalid This the first time I got this error in c#.net....
1
1992
by: twebb72 | last post by:
Scratching my head for a while on this one... This project uses code from "Understanding HttpWebRequest CookieContainer?" post on this site. C#, asp.net 2.0 The following code supplies credentials to the login page properly, if I change the POST credentials, it responds with the invalid login page. On the second get request (after a successful login), it continually redirects to the main page as if the session was over. Here is the code......
2
2346
by: MedIt | last post by:
Hi All, I am trying to Post a number of requests to a web service on a client server from a console application.Through this application I am firing some 400 requests to the Web Service, one after another. Now the problem, the first few requests gets to the web service, and fails all the consecutive requests after that, returning 404 page not found from IIS, not from the Web Service. We had some problem with the proxy setting from our side,...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.