Setting the Prefer header to manage response echo on insert operations
By default, the Create Table and Insert Entity operations return a response payload that echoes the data contained in the request body. For version 2013-08-15 and higher of the storage services and OData data service version 3.0, it is possible to omit the response body echo by setting the Prefer
header to return-no-content
. If the Prefer
header is set to return-no-content
, the service will respond with status code 204 (No Content
) and response header Preference-Applied:``return-no-content
.
You can also set the Prefer
header to return-content
, which provides the default behavior of returning the response payload. In this case, the service will respond with status code 201 (Created
) and response header Preference-Applied:``return-content
.
If no Prefer
header is specified, the service responds with status code 201 (Created
) without the Preference-Applied
header in the response.
For more details, see the documentation for the OData Prefer header.
See Also
Setting the OData Data Service Version Headers
Table Service Concepts