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
1
vote
1 answer

Azure AD Change Password with patch call

I'm currently developing a web app in C#. I'm using Azure AD to store the user infomation, so I would like to be able to change the password at some point if the user wishes to do so. Currently the way I'm changing the password is by using a…
1
vote
2 answers

HTTP Patch Verb not working on windows server 2012 r2

I'm working on single page application which consumes WebApi for data manipulation. My site was hosted on Windows Server 2008 R2 (IIS 7.5.7600.16385) and working fine, however after migration to Windows Server 2012 R2 (IIS 8.5.9600.16384) HTTP PATCH…
1
vote
1 answer

REST PATCH for all resources of a given type

I have a set of resources in a REST API, lets say it something like this: GET /folders [{ "id": "x", "watched": true }, { "id": "y", "watched": true }, ...] I've implemented "stop watching" command as a PATCH: PATCH /folders/x { "watched": false…
Andrey Shchekin
  • 21,101
  • 19
  • 94
  • 162
1
vote
1 answer

PHP not parsing x-www-form-urlencoded data during non-POST requests

Is there a way to get PHP to automatically populate the $_POST superglobal array when request bodies are provided as x-www-form-urlencoded or multipart/form-data during a non-post request? Currently, if I issue a PATCH request with a request body…
Alexander Trauzzi
  • 7,277
  • 13
  • 68
  • 112
0
votes
0 answers

Does JSON Patch Operation support creation of new key,an array, in a JSON Object?

I am trying to add new array key in JSON object but it is not adding a new element. Below this usedReference is not present in the JSON object. I want to create this array Element usedReference without updating the JSON object. { "op": "add", …
0
votes
0 answers

JsonPatchDocument problems with Minimal API in .NET6 / 7 parameter Json problems

Struggling to get MapPatch to work with minimal API and JsonPatchDocument. The result when passing in a valid json PATCH object is always 'Failed to read parameter "JsonPatchDocument patchDocument" from the request body as JSON' and 'The JSON value…
0
votes
0 answers

PATCH HTTP Method : java.lang.NoClassDefFoundError: org/apache/http/conn/ssl/TrustAllStrategy in Java 8

I am posting JSON Payload to REST API by using PATCH method with the help of apache http client libraries Java Version: 1.8.0_171 Following this link for PATCH method with apache http client Code snippet in blog: try { //This is just to…
Justin
  • 855
  • 2
  • 11
  • 30
0
votes
0 answers

Need help parsing values into HTTP Patch Request

I am trying to create an Azure Logic App to activate/deactivate a user. This is the actual user data set that I have. End Goal: I am trying to change "active":false { "emails": [ { "type": "work", "value":…
0
votes
0 answers

Http Patch with JsonPatchDocument and private setters

I have an entity with private setters and want to use JsonPatchDocument to create my HTTP patch route. My entity has private setters because I use the constructor to fill these fields; removing it is not an option here. Is there any way to do…
flvrm92
  • 33
  • 1
  • 7
0
votes
1 answer

How make dataclass for partial update(Patch method)?

Use @dataclass in my project. Now I want to implement @dataclass for PATCH method(partial_update) and initialize only provided arguments. For example: @dataclass class Person: id: int first_name: Optional[str] last_name: Optional[str] …
0
votes
0 answers

Restrict fields from being changed by json-patch

Is there a way to restrict (or only allow) certain fields from being altered by a json-patch method? Is this even a desired feature of HTTP PATCH? I could not find anything (neither positive nor negative) in the respective rfc-5789 documentation I'm…
ch1ll
  • 419
  • 7
  • 20
0
votes
0 answers

REST PATCH/PUT with version of model

Via GET I receive a representation of an entity which includes a version attribute. Now I want to PATCH that entity, do I include this very version attribute and let the server decide to either accept or decline (if it was altered in the meantime)…
ch1ll
  • 419
  • 7
  • 20
0
votes
0 answers

Dynamics D365 Virtual Entity - Odata v4 Provider: CRUD with OptionSet enum

Proplem When creating Virtual Entities in Dynamics 365 (using the Odata v4 Provider) According to MS documentation OptionSet fields cannot be mapped using Int and that enum should be used: Below an example of an odata $metadata: Note statusCode uses…
Shane_Yo
  • 770
  • 8
  • 24
0
votes
1 answer

HttpPatch return "The target location specified by path segment was not found" error

I want to change values in database using http patch method. But it returns erorr "The target location specified by path segment was not found" [HttpPatch()] [Route("[action]/{age}")] public IActionResult PatchEmployee([FromRoute]…
0
votes
2 answers

JSON Patch HTTP request from client to API (published on AWS) returns "StatusCode: 405, ReasonPhrase: 'Method Not Allowed'"

I have an ASP.NET Core Web API published to Amazon ECS using AWS Fargate with working PATCH request that I have successfully tested using POSTMAN. Now I am trying to make that request in the client side application by following this. What I have on…
khaira777
  • 26
  • 5