what does @PatchMapping do

PUT (defined by RFC 7231) and PATCH (defined by RFC 5789) are two 
different methods used for a similar purpose: to request that the 
server make its representation of a resource match the representation on
the client.

Imagine, if you would, trying to update a web page provided by a
server. The client first obtains a recent copy of the server's
representation:

GET /foo
and then, using the client's favorite local HTML editor, makes changes
to this private copy. When the client has finished making the changes,
we want to send those changes back to the server to be used.

The straight forward way to do this in HTTP is to simply send the entire
updated representation back to the server:

PUT /foo

<html>....</html>
When the representation is very large (compared with the HTTP headers), 
and the edits are very small (compared to the document), then PUT becomes
a somewhat "expensive" way to achieve what ought to be a small thing.

To that end, we might also support PATCH, so that instead of sending the
entire document, we just send a representation of the changes we made: a
patch document.

When the server receives our patch, it loads its own copy of the 
document, applies the changes described by the patch document, and saves
the result.

Thus: the overall use case is the same: remote authoring. You load a 
representation of a resource into your HTTP aware document editor, make 
a few changes, and hit "save", and your editor knows what to do to 
communicate your edits back to the server.

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source