• #29668
    Salesforce | Sanjana Sanjana #323

    What is the use of HTTP POST in Salesforce?

    What is the use of HTTP POST in Salesforce?



    Hello Sanjana,

    There are various methods used while making a callout through HTTP. The HTTP-‘POST’ method is used when we are to post a data to the server or create a resource for a client to use.

    Salesforce | Parul Parul #2

    The @HttpPost annotation is used at the method level and enables you to expose an Apex method as a REST resource. This method is called when an HTTP POST request is sent, and creates a new resource. To use this annotation, your Apex method must be defined as global static.



    Salesforce | shariq shariq #1


    Making your Apex class available as a REST web service is straightforward. Define your class as global, and define methods as global static. Add annotations to the class and methods. For example, this sample Apex REST class uses one method. The createRecord method is a custom REST API call. It’s annotated with @HttpPost and is invoked for a POST request.

    global with sharing class MyRestResource {
    global static Account createRecord() {
    // Add your code

    Hope this helps!



    We can use HTTP POST in Salesforce to push or create new resources.


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

Please to reply to this topic.


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


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 2019 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?