Giter VIP home page Giter VIP logo

Comments (7)

jaytaph avatar jaytaph commented on July 19, 2024

The problem is that PATCH does not need explicitly a diff media type. We could expand the recipe by adding a diff media type (like a diff output) and show the result (and point out the non-idempotency as a drawback)

A non-diff media-type, like the example given, should stay, but we could explain what the result would be, which in this case would that the firstname of the user will be changed (in a idempotent way).

from restcookbook.

steveklabnik avatar steveklabnik commented on July 19, 2024

The set of changes is represented in a format called a "patch
document" identified by a media type.

and

With PATCH, however, the enclosed entity contains a set
of instructions describing how a resource currently residing on the
origin server should be modified to produce a new version.

from restcookbook.

jaytaph avatar jaytaph commented on July 19, 2024

I will try and see if I can get this sorted a bit better.. to be honest, PATCH is defined pretty vaguely when it comes to their media types.

from restcookbook.

steveklabnik avatar steveklabnik commented on July 19, 2024

Yeah, I'm not 100% happy with the spec, but what are you gonna do?

from restcookbook.

jaytaph avatar jaytaph commented on July 19, 2024

amend it :) I think the restcookbook.com should be a way to give people at least some examples on how to implement this. I don't think it's perfect, but at least if we can give some examples, with the pros and cons, it would at least give people some insight without trying to invent everything by itself.

from restcookbook.

steveklabnik avatar steveklabnik commented on July 19, 2024

👍

from restcookbook.

jpink avatar jpink commented on July 19, 2024

PATCH and PUT doesn't have same content type! Please read "Please do not patch like an idiot".

from restcookbook.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.