Skip to main content
Level 2
Oct 12, 2023 3:41 AM UTC
Solved

How to build a PATCH method service?

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!

 

 

kapil_rajoria
kapil_rajoriaAccepted solution
Community Advisor
Oct 12, 2023 9:18 AM UTC

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
Oct 12, 2023 9:18 AM UTC
kapil_rajoria
Community Advisor
kapil_rajoriaCommunity AdvisorAccepted solution
Community Advisor
Oct 12, 2023 9:18 AM UTC

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.

Translate
kautuk_sahni
Level 9
Oct 13, 2023 10:31 AM UTC

@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.

Translate
Kautuk Sahni