Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Modification Request succeeds, but response body cannot be created #443

Closed
ralfhandl opened this issue Mar 21, 2024 · 0 comments · Fixed by #212
Closed

Data Modification Request succeeds, but response body cannot be created #443

ralfhandl opened this issue Mar 21, 2024 · 0 comments · Fixed by #212
Labels
Protocol Protocol, URL Conventions V4.01_ERRATA01

Comments

@ralfhandl
Copy link
Contributor

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.

Imported from ODATA-1609

@ralfhandl ralfhandl added Protocol Protocol, URL Conventions V4.01_ERRATA01 labels Mar 21, 2024
@ralfhandl ralfhandl mentioned this issue Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Protocol Protocol, URL Conventions V4.01_ERRATA01
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant