Duration (Pacific Standard Time):
To (Pacific Standard Time):
  • None
User Action:
  • None

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 Enumeration DataServiceResponsePreference
Dim instance As DataServiceResponsePreference
Member name Description
IncludeContent Requests that the data service returns a copy of the inserted or changed entity as an entry in the body of the response message.
NoContent Request that the data service not return a copy of the inserted or changed entity as an entry in the body of the response message.
None The 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.