• #29847
    Forcetalks

    What is the difference between PUT and POST methods of REST API in Salesforce?

    What is the difference between PUT and POST methods of REST API in Salesforce?

    Tagged: , , , , , , , ,

    #30627
    Forcetalks

    hello Shradha

    HTTP.POST can be used when the client is sending data to the server and the server will decide the URI for the newly created resource, whereas HTTP.PUT can be used when the client is sending data to the server and the client is determining the URI for the newly created resource

    #35150
    Salesforce | shariq shariq #1
    Forcetalks

    Hi,

    POST is used to create a new entity. “Post” means “after”; if you have a collection of entities and you tack a new one onto its end, you have posted to the collection. You can’t post an existing entity, and it’s common (though not always required) to use the collection’s URI to post. (E.g. you would create a new Quora user named Noah by POSTing to https://quora.com/users as opposed to https://quora.com/users/noah.)
    PATCH is used to update an existing entity with new information. You can’t patch an entity that doesn’t exist. You would use this when you have a simple update to perform, e.g. changing a user’s name.
    Finally, PUT is used to set an entity’s information completely. PUTting is similar to POSTing, except that it will overwrite the entity if already exists or create it otherwise. You could use a PUT to write a user to your database that may already be in it.

    Hope this helps.

Viewing 3 posts - 1 through 3 (of 3 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 2018 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?