.NET Framework Class Library
ServicePoint..::.Expect100Continue Property

Gets or sets a Boolean value that determines whether 100-Continue behavior is used.

Namespace:  System.Net
Assembly:  System (in System.dll)
Syntax

Visual Basic (Declaration)
Public Property Expect100Continue As Boolean
Visual Basic (Usage)
Dim instance As ServicePoint
Dim value As Boolean

value = instance.Expect100Continue

instance.Expect100Continue = value
C#
public bool Expect100Continue { get; set; }
Visual C++
public:
property bool Expect100Continue {
    bool get ();
    void set (bool value);
}
JScript
public function get Expect100Continue () : boolean
public function set Expect100Continue (value : boolean)

Property Value

Type: System..::.Boolean
true to expect 100-Continue responses for POST requests; otherwise, false. The default value is true.
Remarks

When this property is set to true, client requests that use the POST method expect to receive a 100-Continue response from the server to indicate that the client should send the data to be posted. This mechanism allows clients to avoid sending large amounts of data over the network when the server, based on the request headers, intends to reject the request.

For example, assume the Expect100Continue property is false. When the request is sent to the server, it includes the data. If, after reading the request headers, the server requires authentication and sends a 401 response, the client must resend the data with proper authentication headers.

If the Expect100Continue property is true, the request headers are sent to the server. If the server has not rejected the request, it sends a 100-Continue response signaling that the data can be transmitted. If, as in the preceding example, the server requires authentication, it sends the 401 response and the client has not unnecessarily transmitted the data.

Changing the value of this property does not affect existing connections. Only new connections created after the change are affected.

The Expect 100-Continue behavior is fully described in IETF RFC 2616 Section 10.1.1.

Examples

The following code example displays the value of this property.

Visual Basic
Console.WriteLine("UseNagleAlgorithm = " + sp.UseNagleAlgorithm.ToString())
Console.WriteLine("Expect 100-continue = " + sp.Expect100Continue.ToString())
C#
Console.WriteLine ("UseNagleAlgorithm = " + sp.UseNagleAlgorithm.ToString ());
Console.WriteLine ("Expect 100-continue = " + sp.Expect100Continue.ToString ());
Visual C++
Console::WriteLine( "UseNagleAlgorithm = {0} ", sp->UseNagleAlgorithm.ToString() );
Console::WriteLine( "Expect 100-continue = {0}", sp->Expect100Continue.ToString() );

CPP_OLD
Console::WriteLine(S"UseNagleAlgorithm = {0} ", sp->UseNagleAlgorithm.ToString());
Console::WriteLine(S"Expect 100-continue = {0}", sp->Expect100Continue.ToString());
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1

.NET Compact Framework

Supported in: 3.5, 2.0
See Also

Reference

Tags :


Page view tracker