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

Why HTTP PATCH request method is not idempotent

Its mentioned on HTTP Spec that PATCH is not idempotent. The basic definition of idempotent is: An idempotent HTTP method is a HTTP method that can be called many times without different outcomes So If we make an HTTP call PATCH /users/1 { …
Nazar Hussain
  • 5,102
  • 6
  • 40
  • 67
1
vote
1 answer

Django Rest Framework: Patching a OneToOneField

I need help with a PATCH request using Django rest framework. I have a User model that inherits from AbstractBaseUser which has 2 fields: name and email. The email field is unique. Then I have a DojoMaster model that has a OneToOne relationship with…
dot64dot
  • 531
  • 1
  • 6
  • 15
1
vote
0 answers

JSON Patch - Document synchronization between client and server

We have a complex JSON document. We currently manage changes with GET/POST operations involving the entire document. We would like to stop sending the entire document back and forth, so we are looking into JSON Patch. There are libraries to…
jparram
  • 804
  • 8
  • 24
1
vote
1 answer

AsyncHttpClient: can not resolve patch android

AsyncHttpClient can not call patch android. How to call it thanks! RequestParams params = new RequestParams(); String URL = "xxxxxx; params.put("aaa", aaa); params.put("bbb", bbb); AsyncHttpClient client = new…
ARR.s
  • 769
  • 4
  • 20
  • 39
1
vote
0 answers

Cannot resolve the symbol HttpPatch while using import statement 'import org.apache.http.client.methods.HttpPatch'

Cannot resolve the symbol HttpPatch, while using import statement : import org.apache.http.client.methods.HttpPatch I also added required dependencies in gradle file. I actually want to make patch call and send JSON object as a body. I am new to…
Divya
  • 11
  • 2
1
vote
1 answer

Getting error while using PATCH method in HttpURLConnection

Here from the last few hours, I am trying to update some field of resource using HttpURLConnection PUT method. But now I've changed this to PATCH. I am able to perform GET and POST, but in Http method PATCH keep getting error. The request not even…
Shambhu
  • 181
  • 6
  • 16
1
vote
0 answers

Web Api unit test for PATCH endpoint

I am trying to develop a PATCH endpoint in my web api application. In the update model I have attributes for required data and some custom attributes. Since I found out that the attribute validation is not executed as expected in PATCH endpoints I…
1
vote
1 answer

How to workaround PATCH-request, if PATCH not supported serverside

I'm using ColdFusion 10 to communicate with PayPal's servers and for some requests I'd need to do HTTP PATCH requests which are not supported by CF10. Is the PayPal REST API offering an alternate method to fake PATCH requests like appending…
Seybsen
  • 14,989
  • 4
  • 40
  • 73
1
vote
0 answers

Correct way to do a PATCH upsert request

What is the proper way to request the following upsert to a REST API? I'm struggling to structure a NoSQL collection, which is based on the most requested returns to the front-end application. Suppose you have the following document: { 'user' :…
vibn
  • 11
  • 3
1
vote
2 answers

HTTP ReST: update large collections: better approach than JSON PATCH?

I am designing a web service to regularly receive updates to lists. At this point, a list can still be modeled as a single entity (/lists/myList) or an actual collection with many resources (/lists/myList/entries/). The lists are large (millions…
Tomas Creemers
  • 2,645
  • 14
  • 15
1
vote
1 answer

How do I use the Apache HttpClient library to submit a PATCH request with JSON data?

I’m using Apache HTTP client v 4.3.4. How do I submit JSON data to a URL via the PATCH method? I have tried this // Create the httpclient HttpClient httpclient = HttpClientBuilder.create().build(); // Prepare a request object …
Dave
  • 15,639
  • 133
  • 442
  • 830
1
vote
1 answer

HttpPatch request in Asp .NET MVC

I'm trying to use method in controller with HttpPatch annotation. My problem is that when i'm triggering that method, I have 404 error, resource not found. It seems that i'm not satisfying method needs and sending HttpPost request when i'm pressing…
podhornyi96
  • 43
  • 10
1
vote
1 answer

Best approach for updating a relation to another resource in a REST API

Let's say I have a REST API adhering to basic HATEOAS principles. Items belong to a User. GET /item/13 { id: 13, name: 'someItem', type: 'someType', _links: [ { rel: 'user', href: '/user/42' } ] } Now I need…
JHH
  • 8,567
  • 8
  • 47
  • 91
1
vote
1 answer

How to use PATCH method in CXF Client

I was trying to call a API with PATCH method using CXF (Version 3.1.3) client. Tried following the steps specified in below threads but not able resolve. Only getting URLConnectionHttpConduit instead of…
1
vote
5 answers

JMeter: How to send parameters with PATCH method?

My JMeter version is the latest version 2.13. I would like to add an HTTP request to test my API, and the method is either PATCH or PUT. In Postman, I can test the API and succeed using the PATCH method with some URL parameters. For example: URL:…
Anson Liao
  • 41
  • 1
  • 4