You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a data modification request that requires a response body (for example, creation with Prefer: return=representation or $expand). Imagine that the data change is committed to the database, but the subsequent database SELECT statement fails for some reason.
How shall the server respond to indicate that the data are changed on the database, yet there is no response body?
204 No Content plus Location header after an entity creation
204 No Content without Preference-Applied: representation header after an update with Prefer: return=representation
Proposal
OData-Protocol, section 11.4.2:
Upon successful creation of the entity, the service MUST respond with either 201 Created and a representation of the created entity, or 204 No Content if the request included a Prefer header with a value of return=minimal and did not include the system query options $select and $expand,or if a representation of the created entity could not be constructed. In either case, the response MUST contain a Location header that contains the edit URL or read URL of the created entity.
OData-Protocol, section 11.4.3:
Upon successful completion of the update, the service responds with either 200 OK and a representation of the updated entity, or 204 No Content, for example, if the request did not specify a Prefer Header with a value of return=representation and did not include the system query options $select and $expand, or if a representation of the updated entity could not be constructed.
Consider a data modification request that requires a response body (for example, creation with
Prefer: return=representation
or$expand
). Imagine that the data change is committed to the database, but the subsequent databaseSELECT
statement fails for some reason.How shall the server respond to indicate that the data are changed on the database, yet there is no response body?
Location
header after an entity creationPreference-Applied: representation
header after an update withPrefer: return=representation
Proposal
OData-Protocol, section 11.4.2:
Upon successful creation of the entity, the service MUST respond with either
201 Created
and a representation of the created entity, or204 No Content
if the request included a Prefer header with a value ofreturn=minimal
and did not include the system query options$select
and$expand,
or if a representation of the created entity could not be constructed. In either case, the response MUST contain aLocation
header that contains the edit URL or read URL of the created entity.OData-Protocol, section 11.4.3:
Upon successful completion of the update, the service responds with either 200 OK and a representation of the updated entity, or 204 No Content, for example, if the request did not specify a Prefer Header with a value of return=representation and did not include the system query options $select and $expand, or if a representation of the updated entity could not be constructed.
Imported from ODATA-1609
The text was updated successfully, but these errors were encountered: