.NET Framework (current version)
Gets or sets the value of the
Connection HTTP header. Namespace:
System (in System.dll)
member Connection : string with get, set
The value of the
Connection HTTP header. The default value is null.
The value of
is set to Keep-alive or Close. Connection
The request sends the
property to the Internet resource as the Connection Connection HTTP header. If the value of the property is KeepAlive true, the value "Keep-alive" is appended to the end of the Connection header.
To clear the
Connection HTTP header, set the property to Connection null.
property after the request has been started by calling the Connection GetRequestStream, BeginGetRequestStream, GetResponse, or BeginGetResponse method throws an InvalidOperationException.
The value for this property is stored in
WebHeaderCollection. If WebHeaderCollection is set, the property value is lost.
The following code example uses the
property to set the value of the Connection HTTP Header. Connection
No code example is currently available or this language may not be supported.
.NET Framework Available since 1.1 Return to top