-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
note down differences in PUT, POST and PATCH #35
Comments
Would you be up for taking a first pass at this? It could probably fit in the |
@geemus I had a look at the heroku platform API and noticed that you're supporting the wide-spread (wrong?) use of PATCH as a partial resource update action, instead of how it's described in RFC 5789
Is this deliberate? And if so, why? Or am I misinterpreting the spec? |
Of course only seconds after posting I found this: http://tools.ietf.org/html/draft-ietf-appsawg-json-patch-10 A spec on how to describe PATCH operations through JSON API's. E.g.: { "op": "replace", "path": "/a/b/c", "value": 42 } The
Anyway, converting an example from the heroku docs would make it: $ curl -n -X PATCH https://api.heroku.com/account \
-H "Accept: application/vnd.heroku+json; version=3" \
-H "Content-Type: application/json" \
-d '{
"op": "replace", "path": "email", "value": "[email protected]"
}' |
And sorry for hijacking this thread, but come to think of it, this would mean the |
@creynders - I can certainly see what you are getting at. In our case, we just wanted partial update. ie we simplify the usage a bit through the assumption that you ALWAYS want to do replace ops and you are just specifying key/value. I think this is still in the spirit of the RFC, though one could argue we should be using a special media type that better defines these expectations. ie we just have a much simpler/more naive patch document format than say json-patch. I don't think this would be sufficient to accomodate Hope that helps clarify a bit, but certainly happy to further discuss. |
it'd be great to mention that POST is typically used for creating things (
POST /articles
), and PUT/PATCH for editing (PUT /articles/123
).The text was updated successfully, but these errors were encountered: