This is the basic code.
Now it depends on how you are doing Callout. If you have WSDL and converted into apex and then you may use stub classes.
The above example doesn't include any code for authentication, if your request needs this you will need at add this in. This is one of areas of salesforce with the best documentation.
Welcome to the Apex Blog
As you start to explore outbound requests I suggest you read up on the following:. Apex Web Services and Callouts. Starting in Spring , you can use Named Credentials.
How and why you should republish blog content
As a bonus, Named Credentials do not have to be configured in the Remote Site setup area. This will allow for you to configure different in different environments Sandbox vs Production without having to change any code or create custom settings.
Home Questions Tags Users Unanswered. How to make a post request to some other server from apex controller Ask Question. Asked 7 years, 1 month ago.
Active 2 years, 1 month ago. Viewed 40k times. Thanks in advance.
Eric 50k 7 7 gold badges 63 63 silver badges bronze badges. Pramod Kumar Pramod Kumar 4, 11 11 gold badges 45 45 silver badges 79 79 bronze badges.
Mohith Shrivastava Mohith Shrivastava I didn't get how to set request parameter in Post request? Will i have to set them header?
Apex Process Consultants help their clients succeed at digital transformation
Reference Information This is one of areas of salesforce with the best documentation. Ryan Guest Ryan Guest 3, 1 1 gold badge 17 17 silver badges 35 35 bronze badges.
Sign up or log in Sign up using Google. Sign up using Facebook.
From the Blog
Sign up using Email and Password. Post as a guest Name.
Email Required, but never shown. How to create micro-interactions with react-spring: Part 1. This week, StackOverflowKnows syntactic sugar, overfit or nah, and the…. Featured on Meta.
Thank you, Robert Cartaino. Change in roles for Jon Ericson leaving SE. Linked 2.