When overridden in a descendant class, gets or sets the content length of the request data being sent.
Assembly: System.Net (in System.Net.dll)
Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
The property contains the number of bytes of data sent to the Internet resource by the WebRequest instance.
The property can be used to set the Content-Length header on an instance of HttpWebRequest class. This property is supported on both the browser and client HTTP stacks. On the browser HTTP stack, the property is not required to be set because the Silverlight runtime will automatically populate the Content-Length header with the correct value based on the buffered request body. If a Silverlight application on either the browser or client HTTP stack sets this property to a value that does not match the size of the provided request body, a ProtocolViolationException is thrown when the request is sent. On the client HTTP stack if AllowWriteStreamBuffering is false, the property must be used to set the correct value of the Content-Length header before calling the BeginGetRequestStream method.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.