• #61037
    Forcetalks

    what is the difference between post and put in Salesforce?

    what is the difference between post and put in Salesforce?

     

    • This topic was modified 5 months ago by  Gursimran Singh.
    • This topic was modified 5 months ago by Salesforce | Team Team.
    #66926
    Salesforce | Anjali Anjali #17
    Forcetalks

    All these annotations are used at the Method level and enables us to expose an Apex method as a REST resource. And here are the differences –

    HttpPut – Used for Create and Update
    HttpPost – Used for Create

    and there is another method also present- HttpPatch – Used for Update
    So if you only wish to create a new record then you can use HttpPost. If you wish to first check if a record exists and only when it does not exists then create a new record, use HttpPut. And if you are sure that the record exists and in case it does not then you wish to throw error then use HttpPatch.

    Hope this helps!

Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?