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
2
votes
4 answers

Spring MVC Request method 'PATCH' not supported

Is HTTP PATCH not enabled by default in Spring MVC/Boot? I'm getting the ff error: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'PATCH' not supported at…
Julez
  • 1,010
  • 22
  • 44
2
votes
1 answer

devops REST API: can not update work item status using PATCH method

I am using DevOps restapi to get some information. The POST method is working fine for me. I want to update the status of my work item. For that I need to use the PATCH method. Which is not working, and not giving any kind of…
2
votes
2 answers

Is there a JavaScript resource extension for PATCH in MarkLogic?

I have a requirement to call the patch method from a custom REST endpoint. I've searched in the MarkLogic documentation and found this sample code - function get(context, params) { // return zero or more document nodes }; function post(context,…
Hank
  • 131
  • 4
2
votes
1 answer

Django - How can I do PATCH requests - ModelSerializer, RetrieveUpdateDestroyAPIView

I have a ProfileSerializer which is a ModelSerializer: class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('first_name', 'last_name', 'email', 'password') class…
2
votes
0 answers

Non-null fields validation only

In my springboot app I'm using PATCH HTTP method to update an entity. Of course via DTO, not directly. Since this is PATCH method I'm not all fields will be set and I want to validate (in terms of javax.validation.constraints package) only those…
Opal
  • 81,889
  • 28
  • 189
  • 210
2
votes
1 answer

Running Jax-rs 2.1 HTTP PATCH on Wildfly - 405 Method Not Allowed

I am trying to run a rest api with a http patch method on a wildfly 10.1.0.Final. If I made a request on this endpoint i get a 405 Method Not Allowed. I use javax.javaee-api:8.0. Patch: @PATCH @Path("/documents/{id}") public Response…
mutzel
  • 23
  • 4
2
votes
1 answer

HTTP PATCH Method C#

I don't see the option of including a HTTP "PATCH" request, I don't get the option using Visual Studio Intellisense? How do I include the "PATCH" method in this code instead of "POST" using (HttpClient httpClient = new HttpClient()) { Uri…
Ravi Shastri
  • 57
  • 1
  • 2
  • 12
2
votes
1 answer

HTTP PATCH verb support status

Which browsers support HTTP PATCH now, I've not found any recent information online. I'm especially interested to know if Chrome, Internet Explorer 11 and Microsoft Edge support the HTTP PATCH verb. I need this because I'm wondering if I should…
user152949
2
votes
1 answer

HTTP PUT not working properly in django rest framework

I am using the following code in django rest framework to achieve put and patch functionality. The PATCH (partial_update) works fine, however, providing fewer fields for the PUT would not replace the whole resource as a PUT request should. For…
2
votes
1 answer

Chrome data compression proxy error with jquery ajax PATCH method

I am having web page make ajax HTTP PATCH call to the same domain restful service. It failed ONLY for mobile phone for chrome browser, like the below $.ajax({ url : "same-domain/path", data : "{}", type : 'PATCH', headers: { …
2
votes
0 answers

Why does PATCH on Django Rest Framework wipe an unchanged ManyToMany field?

I am PATCHing a model using DRF, and the call is, for some reason, wiping a ManyToMany field. Why is this? I have a Feature model: class Feature(CommonInfo): user = models.ForeignKey(User) name = models.CharField(max_length=50) parent =…
awidgery
  • 1,896
  • 1
  • 22
  • 36
2
votes
1 answer

using PATCH with a Django image field and s3

In my current project I have my images stored on a s3 bucket. I have a pre_save signal receiver to delete the actually image from the s3 bucket on the Image class. class Image(models.Model): name = models.CharField(max_length = 255) caption…
Yoav Schwartz
  • 2,017
  • 2
  • 23
  • 43
2
votes
1 answer

JRuby, Sinatra, Warbler app - HTTP PATCH request fails with 501 error

I've created a simple web service using JRuby 1.7.4, Sinatra 1.4.4 and Rack 1.5.2. This web service responds to GET, POST, PATCH and DELETE requests with a simple message "Hello world using [request-type]". I started Rack and tested all the request…
Sandeep M
  • 2,942
  • 2
  • 13
  • 17
2
votes
1 answer

Use of JSON-PATCH format

I have a question regarding the JSON-PATCH format specified in RFC6902. As I understand this format good for PATCH requests. Is there a way of using this in the response, may be using partial content code? I have a special case in which operations…
Sajith
  • 106
  • 5
2
votes
0 answers

PATCHing entities in Web API

I was wondering how to use the PATCH HTTP verb on my application since sometimes I don't need to update the whole entity. The problem, is that in C# the lack of value is represented by null (there is not undefined like in JS). So considering that I…
vtortola
  • 34,709
  • 29
  • 161
  • 263