-
-
Notifications
You must be signed in to change notification settings - Fork 745
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
POST and PATCH response should contain item data #36
Comments
Again it's all about minimizing payload size. Currently, POST and PATCH responses only contain fields that the API updates for the client ('updated', 'created', '_id', 'etag', etc.). In case of a POST the client knows the other field values (it posted them). In case of a PATCH, the only issue could be the with the 'etag' being in the header and not in the payload (we discussed this in #29). Since a client must provide the previous 'etag' in order to successfully patch, it is assumed that it knows the item already. An eventual 'COHERENCE_MODE` setting (as discussed in #29) could also fill PATCH/POST responses with all the extra fields I guess. |
Agree. The main issue is that there is no etag at all returned from POST... |
Right! |
Thank you @hluz, by addressing your PRs I also got the chance to improve performance, especially with multiple document insertions (but also on PATCH), and refactor some things I didn't like in my code. |
AngularJS/resource could definitely make use of this "COHERENCE MODE." Although a valid 'If-Match' header / etag means that the client already has the latest data, AngularJS/resource completely overwrites the object with the response. The correct solution is to make AngularJS/resource aware of this, but it sure would be nice just to flick on this mode... |
@nicolaiarocci I'd like you to reconsider adding Also, though it may seem like a waste of bandwidth because the client should 'know' what the values are, there may arise a situation (because of encoding or some other issue) where the |
@nicolaiarocci, I'd like to submit a pull request for this feature in milestone 0.4. |
@jenmontes @joshvillbrandt would you please open a separate ticket for the |
By the way, I noticed that the |
The response resulting of a successful POST or PATCH should contain the full content item(s) created or updated, including the etag values (or it could be an optional capability). Currently to get that information it required a GET following the POST or PATCH (or multiple in case of multiple inserts)
The text was updated successfully, but these errors were encountered: