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

Proper way to update mongo in patch action in web api

I want to implement Patch action in web api, consider I have Customer collection in mongo like this: public string Id{ get; set; } public string Name{ get; set; } public string Family{ get; set; } public string Sex{ get; set; } public string City{…
someone
  • 535
  • 4
  • 14
0
votes
1 answer

POST/PATCH works in LoopBack Explorer but not Postman

I am building an Angular app that uses a REST API built from NodeJS and LoopBack. When trying to create new records, I'm getting a weird error both from my app and also in Postman. (Property names have been changed to protect the innocent) The…
Chris Hampton
  • 109
  • 1
  • 9
0
votes
2 answers

How to put JSON array in request body for Retrofit?

The server API takes a JSON array in the request body. Like this: [ { "key1" : "value1", "key2" : "value2", "key3" : "value3" } ] I know how to put a JSON object as the body, but how can I put a JSON array in a retrofit request? I…
kyrax
  • 1,192
  • 3
  • 13
  • 29
0
votes
1 answer

Getting Error java.lang.NoClassDefFoundError: sun/net/www/protocol/https/HttpsURLConnectionImpl when deployed in Jboss EAP 6.4.x

I am writing a rest client using java.net which should do a PATCH request. But as PATCH is not a supported method in java.net, I used reflection to make it supported by changing the code like private void updateConnectionToSupportPatchRequest(final…
ashishSinghT
  • 103
  • 1
  • 1
  • 5
0
votes
2 answers

OData v4.0 - PUT, PATCH, DELETE return 404

We have a C# .NET Web Api project with the following Nuget packages, amoungst others: MVC 5.2.3 Microsoft ASP.NET Web API 2.2 for OData v4.0 (version 6.0.0) Microsoft.AspNet.OData.Versioning (version 2.1.0) In IIS, PUT, PATCH and DELETE verbs have…
user2146402
  • 51
  • 1
  • 3
0
votes
1 answer

Understanding a PATCH request

The following is the structure of my content in MongoDB { partnerName: "Zumba Fitness", supportedProducts: [ "Fitness 1.0", "Protein Bars" ] } I want to modify/update the contents of supportedProducts upon a PATCH request. For example,…
user8222014
  • 113
  • 1
  • 1
  • 4
0
votes
2 answers

HTTP Patch Delta is Null with oData web service

I am using entity framework code first. My entities and controller were generated by Visual Studio and have not been modified. This issue seems to be that the DELTA for my patch request is null. The innererror on the web service is 'Object…
Nate23VT
  • 423
  • 8
  • 27
0
votes
1 answer

How do I use my coffeescript to change the form method to PUT/PATCH?

I'm using Rails 4.2.3. In my coffee script, I’m manually editing the URL and action of a form to be like so … # Alter the form submit behavior $('#new_my_object').attr("action", "/my_objects/" + id) $('#new_my_object').attr("method",…
Dave
  • 15,639
  • 133
  • 442
  • 830
0
votes
2 answers

Trouble updating a field of type lookup with Microsoft CRM 2016 Web API

I currently have some code that uses http patch to send Microsoft CRM data via the 2016 web api. When my payload includes a text or int datatype it works just fine, but when the payload includes a lookup record I can't get any response beyond 400…
mucle6
  • 645
  • 1
  • 10
  • 24
0
votes
1 answer

Potential vulnerability using PATCH method

I am currently developing a web application in Laravel PHP framework to handle all the data input using HTML form. Creating new entry in database is not an issue as it uses POST method, which the ID is hidden from the user, and there is validation…
Woody
  • 612
  • 9
  • 21
0
votes
0 answers

HTTPClient's PATCH method not allowing body entity?

I am using Apache HTTPClient version 4.3.5. I am trying to create a HTTP PATCH request. HttpPatch request = new HttpPatch(ServerURL); StringEntity params = new StringEntity(requestBody,…
Vel Ganesh
  • 537
  • 3
  • 12
  • 32
0
votes
1 answer

Rails - override a setter for an active record attribute

I am building a rails server in which some users follow changes in an other users location and get notified by websockets each time the location is updated. Currently I call an update_location action instead of calling regular update in order to…
gilmishal
  • 1,884
  • 1
  • 22
  • 37
0
votes
1 answer

.NET web api HttpPatch returning 403 forbidden

I have a simple resource that provides a list of translations. The get end point takes a language and returns a dictionary of translations. Any updates are going to be on just one translation, so I figured that would be appropriate to do as a…
Danny
  • 308
  • 1
  • 4
  • 12
0
votes
1 answer

Cannot serialize to Delta<> in an OData Controller

I'm implementing an ODataController. It's OData V3 for compatibility reasons with Breeze.js: using System.Web.Http.OData; public class OffersController : ODataMetadataController { ... Somwhere in the middle I want to implement merge/patch as…
vinczemarton
  • 7,756
  • 6
  • 54
  • 86
0
votes
1 answer

Adding an array element to all documents in a collection

My Foo documents have a CustomData collection used to add user-configurable properties. Sometimes, when I create those properties, I'm need to add them with a default value for indexing purposes. This is what I'm trying to use for that…
Diego Mijelshon
  • 52,548
  • 16
  • 116
  • 154
1 2 3
10
11