How to build a PATCH method service? | Community
Skip to main content
Level 2
October 12, 2023
Solved

How to build a PATCH method service?

  • October 12, 2023
  • 3 replies
  • 1594 views
Hello, I am creating some services to connect to some endpoints, the problem is that I need to do it for one with the PATCH method and I don't know how to do it because until now I have only worked with the GET and POST methods. , is there any guide or way to understand how to do it? Thank you very much and greetings!

 

 

Best answer by kapil_rajoria

Hi, the PATCH call is similar to the POST call. The PATCH API call is used to partially update an existing resource on the server. There's not much difference in the methods as well. You can use HttpPatch class instead of HttpPost when dealing with PATCH requests. All the things will remain same, just use the HttpPatch class object everywhere.

3 replies

arunpatidar
Community Advisor
Community Advisor
October 12, 2023
kapil_rajoria
Community Advisor
kapil_rajoriaCommunity AdvisorAccepted solution
Community Advisor
October 12, 2023

Hi, the PATCH call is similar to the POST call. The PATCH API call is used to partially update an existing resource on the server. There's not much difference in the methods as well. You can use HttpPatch class instead of HttpPost when dealing with PATCH requests. All the things will remain same, just use the HttpPatch class object everywhere.

kautuk_sahni
Community Manager
Community Manager
October 13, 2023

@lidermangiraldoescobar  Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni