You need to sign in to do that
Don't have an account?
bujji
Run CURL from APEX class
Hi Guys,
Is there any way that i can run cURL commands in apex call to connect third party systems. Because i am getting some SSL certificate error when i try to connect the third party system but from cURL i am able to connect. Please give me some idea URGENT.
Thanks!
Is there any way that i can run cURL commands in apex call to connect third party systems. Because i am getting some SSL certificate error when i try to connect the third party system but from cURL i am able to connect. Please give me some idea URGENT.
Thanks!
Unfortunately, you cannot run cUrl from Apex. It's an open source tool. See also the following page:
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_curl.htm
It states that cUrl is not supported by Salesforce.
Can you post your code and the error you get? That way we can help you fix your issue with your Apex code.
Best regards,
Martijn Schwärzer
Thanks for your reply. I am able to connect with third party system. But i have a new problem like i am not able to update the third party as i need to use PATCH method. But HTTP Request class is not supporting PATCH method. Is there any way that i can acheive this. Please give me some ideas.
Thanks.
Yes, unfortunately the PATCH method is not supported (yet). I've had the same issue a while ago.
We solved it on the other end, by adding support for a POST call to the rest api. I hope this is also an option for you, that would be the easiest way.
Otherwise, you will have to use some form of middleware that turns your POST message into a PATCH message to the endpoint and passes back the response to Salesforce.
Hope this helps!
Best regards,
Martijn Schwärzer
I have found a way to do that:
You can just add '?_HttpMethod=PATCH' as a query string parameter to the endpoint and make a regular POST request.
That will work.
Good luck!
Best regards,
Martijn Schwärzer