This documentation is archived and is not being maintained.

ServicePoint.Expect100Continue Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

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

[Visual Basic]
Public Property Expect100Continue As Boolean
public bool Expect100Continue {get; set;}
public: __property bool get_Expect100Continue();
public: __property void set_Expect100Continue(bool);
public function get Expect100Continue() : Boolean;
public function set Expect100Continue(Boolean);

Property Value

true to expect 100-Continue responses for POST requests; otherwise false. The default value is true.


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 System.Net.Sockets.ServicePointManager.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 must send a 401 response, the client must resend the data with proper authentication headers. If this 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, like in the previous 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


[Visual Basic, C#, C++] The following example displays the value of this property.

[Visual Basic] 

    Console.WriteLine("UseNagleAlgorithm = " + sp.UseNagleAlgorithm.ToString())
    Console.WriteLine("Expect 100-continue = " + sp.Expect100Continue.ToString())

Console.WriteLine ("UseNagleAlgorithm = " + sp.UseNagleAlgorithm.ToString ());
Console.WriteLine ("Expect 100-continue = " + sp.Expect100Continue.ToString ());


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

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ServicePoint Class | ServicePoint Members | System.Net Namespace