This documentation is archived and is not being maintained.

ServicePointManager.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 Shared Property Expect100Continue As Boolean
[C#]
public static bool Expect100Continue {get; set;}
[C++]
public: __property static bool get_Expect100Continue();
public: __property static void set_Expect100Continue(bool);
[JScript]
public static function get Expect100Continue() : Boolean;
public static function set Expect100Continue(Boolean);

Property Value

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 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 service points. Only new service points created after the change are affected.

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

Example

[Visual Basic, C#, C++] The following example sets this property.

[Visual Basic] 
ServicePointManager.UseNagleAlgorithm = True
ServicePointManager.Expect100Continue = True
ServicePointManager.CheckCertificateRevocationList = True
ServicePointManager.DefaultConnectionLimit = _
    ServicePointManager.DefaultPersistentConnectionLimit

[C#] 
ServicePointManager.UseNagleAlgorithm = true;
ServicePointManager.Expect100Continue = true;
ServicePointManager.CheckCertificateRevocationList = true;
ServicePointManager.DefaultConnectionLimit = ServicePointManager.DefaultPersistentConnectionLimit;

[C++] 
ServicePointManager::UseNagleAlgorithm = true;
ServicePointManager::Expect100Continue = true;
ServicePointManager::CheckCertificateRevocationList = true;
ServicePointManager::DefaultConnectionLimit = ServicePointManager::DefaultPersistentConnectionLimit;

[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.

Requirements

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

ServicePointManager Class | ServicePointManager Members | System.Net Namespace

Show: