function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anil DuttAnil Dutt 

HTTP Post from Apex

Hi,

i want to make a HTTP Post request from Apex class to send an complete Opportunity object to my remote site Action

Here is my code

 Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('http://itinerary.swiftsetup.com/ItineraryBuilder/SendItineraryEmail?op='+Opp);
req.setMethod('Post');
HttpResponse res = h.send(req);
 result = res.getBody();

but getting following error

Invalid HTTP method: Post

Thanks for your help

Jia HuJia Hu
try req.setMethod('POST');