function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChinnoyChinnoy 

When and where to use integration methods?

Hi

can anyone help me on "When and where to use the INTEGRATION Methods" ?

HTTP POST
HTTP GET
HTTP PATCH
HTTP PUSH
HTTP PUT

Thanks in Advance...

Best Answer chosen by Chinnoy
SandhyaSandhya (Salesforce Developers) 
Hi Venkat Gantasala, 

HTTP.POST(CREATE)
 Can be used when the client is sending data to the server, and the server will decide the URI for the newly created resource. The POST method is used to request that the origin server accepts the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.

HTTP.PUT (UPDATE)
Can be used when the client is sending data to the server, and the client is determining the URI for the newly created resource. The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI.


HTTP.PATCH (UPDATE)
Can be used when the client is sending one or more changes to be applied by the server. The PATCH method requests that a set of changes described in the requesting entity be applied to the resource identified by the Request-URI. The set of changes is represented in a format called a patch document.

HTTP.HEAD(HEADER INFORMATION)

Identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.
This means that we have a faster way of checking the headers and some server info for a given resource on the server. So the first trivial way of using an HTTP HEAD request is checking if a given URL is serviceable, a given file exists, etc.. 

HTTP.GET(RETRIEVE DETAILS FROM RECORD)

GET request is sent, to retrieve the information of the specified resource.


HTTP.DELETE(FOR DELETE OPERATION)

DELETE request is sent, to deletes the specified resource.


Please refer below link.

https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST

Hope this helps you!

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
 
Thanks and Regards
Sandhya