Questions tagged [http-patch]

PATCH is one of the http-request methods

While PUT uploads the entire resource of an already existing entity, PATCH is used to send only the changed attributes of a resource to the server.

The PATCH method was specified in RFC 5789, where its use is described as follows:

Several applications extending the Hypertext Transfer Protocol (HTTP) require a feature to do partial resource modification. The existing HTTP PUT method only allows a complete replacement of a document. This proposal adds a new HTTP method, PATCH, to modify an existing HTTP resource.

It specifies the following differences to the PUT method:

The difference between the PUT and PATCH requests is reflected in the way the server processes the enclosed entity to modify the resource identified by the Request-URI. In a PUT request, the enclosed entity is considered to be a modified version of the resource stored on the origin server, and the client is requesting that the stored version be replaced. 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.

See this answer for more information.

156 questions
0
votes
1 answer

backbone.stickit and html-form: How to save (patch) only changed attributes?

tl;dr How to use backbone.stickit with a html form to change an existing model fetched from the server and only PATCH the changed attributes (changed by user input within the html form) to the server? /tl;dr I'm using backbone.stickit in a…
-1
votes
1 answer

Axios Patch method is overriding the existing data

enter image description here If i decide to update only one field and i leave other fields empty because they already have data that i don't need to update, my axios patch method overrides the existing data with an empty data which is a very bad…
Leyksnal
  • 13
  • 5
-1
votes
2 answers

Internal server error when doing Update on Entity Framework

I have a front on angular 14 and a backend on EF in .net core, I don´t understand why the code blows when it reaches _context.Pedido.Update(pedido); [HttpPatch("ActualizarPedido")] //500 (Internal Server Error) public async…
-1
votes
1 answer

Getting a 400 Bad Request error when trying to call PATCH endpoint on .Net Core 3.1 Web API

I'm getting a 400 Bad Request when trying to calling a PATCH endpoint on my Web API (.Net Core 3.1) and I cannot figure out why. My action method looks like this: using Microsoft.AspNetCore.JsonPatch; namespace PropWorx.API.Controllers { …
-1
votes
1 answer

If the browser can cache PATCH requests

If you fetch an image to display a second or n+1 times, or fetch some JSON likewise, and nothing has changed, then the browser shouldn't actually download/fetch the content. This is how GET requests work with caching. But I'm wondering,…
Lance
  • 75,200
  • 93
  • 289
  • 503
-2
votes
1 answer

Should I PATCH by another resource field instead of the ID

There is a REST API that exposes a PATCH /resources/{id} method where the ID is required. However, the project requirement implies updating a resource given another field, the ID is not given. Since the purpose is to update a specific field of the…
1 2 3
10
11