HttpRequestMessageProperty.SuppressEntityBody Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates whether the body of the message is ignored and only the headers are sent.
public:
property bool SuppressEntityBody { bool get(); void set(bool value); };
public bool SuppressEntityBody { get; set; }
member this.SuppressEntityBody : bool with get, set
Public Property SuppressEntityBody As Boolean
Property Value
true
if the message body is suppressed; otherwise, false
. The default is false
.
Examples
HttpRequestMessageProperty reqProps = new HttpRequestMessageProperty();
reqProps.SuppressEntityBody = false;
Dim reqProps As New HttpRequestMessageProperty()
reqProps.SuppressEntityBody = False
Remarks
This property is used for empty message requests: for example, a service that accepts a GET request without a message body. In this case, when building the HttpRequestMessageProperty object for the response message, set the SuppressEntityBody property to true
.
When interoperating with non-WCF services, it is important to note that certain verbs are expected to contain a message body according to the HTTP standard; these include PUT and POST. Other verbs are expected to suppress the message body; these include GET and HEAD.