Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

DataServiceResponsePreference Enumeration

Determines whether the client requests that the data service return inserted or updated entity data as an entry in the response message.

Namespace:  System.Data.Services.Client
Assembly:  Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)
public enum DataServiceResponsePreference
Member nameDescription
IncludeContentRequests that the data service returns a copy of the inserted or changed entity as an entry in the body of the response message.
NoContentRequest that the data service not return a copy of the inserted or changed entity as an entry in the body of the response message.
NoneThe Prefer header is not included in the request, which is the default behavior.

The client uses the DataServiceResponsePreference value to determine whether to generate the Prefer header. When the Prefer header is generated, this value is also used to determine whether to request that the changed entity be returned from an insert or update operation.

The DataServiceResponsePreference property is used for HTTP POST, HTTP PUT, HTTP MERGE, and HTTP PATCH requests. The IncludeContent value is used by the client to request the data service returns the inserted or updated entity in the body of the response message. When this value is supplied to the AddAndUpdateResponsePreference property of the context, the client includes the return-content value in the Prefer header in the request.

The client always processes entries in the response message to HTTP POST, HTTP MERGE, and HTTP PUT requests, regardless of the IncludeContent setting.

The Prefer header is supported in version 3 of the Open Data Protocol (OData) and later versions.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.