You need to sign in to do that
Don't have an account?
Gage Staruch 9
How can I create a post request?
Hello! I'm a newbie developer. I need to create a POST request to a specified URL that triggers from our process builder through an Apex class. Ideally, the body would be something like:
ANY help would be awesome! Even a basic template to get me started.
Thanks all!
{ "FName": "Jeff", "LName": "Test", "Email1": "Jeff@test.com", "Title": "Test", "Phone1": "2244363251", "Company": "Test", "Country": "US", }I've never done a POST request, so I am pretty lost.
ANY help would be awesome! Even a basic template to get me started.
Thanks all!
For sending a post request to a specified URL you can use following two methods:
1. Using workbench:
-Follow the link: https://workbench.developerforce.com/login.php
-Login with Api 45 and produnction.
-From utilities select REST explorer.
-You will get link path, header option if any and request body.
For more on this please follow: https://trailhead.salesforce.com/en/content/learn/modules/api_basics/api_basics_rest
2. Using Apex code:
-You will have to use HTTP class and its request and response class:
-Following is the code for making request to http://my-end-point.com/newCustomer
Above all if you are beginning with salesforce integration do believe on researching stuffs over the net, this is the key for succeeding.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi