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
0 answers

Unable to call Patch method of Web API in ASP.NET Core

My API has a method of type Patch that I need to call from the client. This method is: [HttpPatch("{id}")] public StatusCodeResult Patch(int id, [FromBody]JsonPatchDocument patch) { Reservation res = Get(id); if (res != null) …
yogihosting
  • 5,494
  • 8
  • 47
  • 80
0
votes
1 answer

PATCH entity and related entities in Entity Framework Core via .NET Core Web API

I have a Web API written in .NET Core which uses EF Core to manage inserts and queries to a postgresql database. The API works great for inserts and queries of existing entities, but I am having trouble working out how to do partial 'patch' updates.…
JamesMatson
  • 2,522
  • 2
  • 37
  • 86
0
votes
0 answers

How to patch delta lines to a file using HTTP Patch in JAVA?

I did try to search on how how to update delta part of file, but information I got is more focused on PATCH topic instead of file update itself. I am afraid I am missing something obvious. Can anyone help me with code or to a blog where it is shown?
NiTiN
  • 81
  • 1
  • 9
0
votes
1 answer

Patch Request using Spring Boot Java

I have a problem with my Patch Request with OpenShift Api. This is my actual code : public static HttpStatus PatchHTTPRequestCustomHeaders(String url, String data) { String Bearer = "ayJhbGciOiJSUzI1NiIs..."; HttpHeaders headers…
user11110224
0
votes
2 answers

PATCH Request into Java Spring API

i would like to make a PATCH request in the OpenShift API. To make it easier, we consider that we see this in the OpenShift API : The content can be this : { "limits":{ "cpu":"10m" }, "requests":{ "memory":"1G" } } Or this : { …
user11110224
0
votes
1 answer

Performing a PATCH on a web API using WebClient (.Net 4.0)

I've got a .Net 4.0 WinForms app which uses WebClient (as unfortunately I have not been able to get it to work with HttpWebRequest nor HttpClient, due to it being in .Net 4.0 and not .Net 4.5). It consumes a Web API. It performs a GET on the…
Fabricio Rodriguez
  • 3,769
  • 11
  • 48
  • 101
0
votes
1 answer

How to generate Body Parameters/ Sample Request for Web API Help Page while having access to raw request body

I need help populating the Body Parameters for the documentation of this endpoint. It shows as empty: I realize that the reason this is happening is because I am currently reading the request body and then converting the information to…
Brandon Lumsden
  • 171
  • 1
  • 1
  • 6
0
votes
0 answers

Create a non editable model property in dotnet

i have this model public class AppInfo { [Required(ErrorMessage = "Campo obrigatório")] [NonEditable] public string nick { get; set; } [Required(ErrorMessage = "Campo obrigatório")] [NonEditable] public string version {…
Gabriel Guedes
  • 481
  • 5
  • 15
0
votes
1 answer

Return status for PATCH call on locked record with no changes

I have a RESTful API that contains a typical PATCH call that allows fields to be updated under various conditions. Under some conditions (a particular status or combination of values), changes are "locked out" of a record. If a user makes a PATCH…
0
votes
0 answers

PATCH 405 (Method Not Allowed) Groovy

I'm trying to do a HTTP operation with PATCH method toward a Groovy Script. If I do that request with Postman Interface I obtain a 200 ok but when I do with the Groovy Script I obtain a 405 Error Code. Postman Request: Postman Request That request…
0
votes
1 answer

Supporting the "PATCH" verb - WSHttpHandler handleExchange gives WARNING: Cannot handle HTTP method: PATCH

I have created a class that uses javax.xml.ws.Endpoint to create a REST endpoint: @WebServiceProvider @ServiceMode(value = javax.xml.ws.Service.Mode.MESSAGE) @BindingType(value = HTTPBinding.HTTP_BINDING) public class SpecificRestAPI implements…
simonalexander2005
  • 4,338
  • 4
  • 48
  • 92
0
votes
1 answer

Patch Request File Upload

I have a REST API that I am trying to upload data to , which is basically this : https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update Now, since the only option I have is PATCH, what are the options for me to…
0
votes
2 answers

I am anticipating a patch request but am receiving a post instead

I am submitting the form on my edit.html.erb and it is giving me an error for No route matches [POST] "/grouponepostings/17/edit". I am using simple forms in my document and am not sure how to specify that it is a patch request I seek. Here is…
0
votes
1 answer

Salesforce Rest API patch operation - Bad Request

I'm trying to invoke a PATCH operation on our organization's Salesforce API. The url is correct (format - https://xxxx.salesforce.com/services/data/v43.0/sobjects/Classification__c/objectid?_HttpMethod=PATCH) and so is the JSON content, though you…
Rakesh
  • 654
  • 4
  • 10
  • 23
0
votes
0 answers

Swagger not creating PATCH API

I have a simple API in spring boot using JpaRepository: public interface UserRepository extends JpaRepository {...} I'm able to create a user using POST API: curl localhost:8080/users -i -X POST -H "Content-Type:application/json" -d…
AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277