You need to sign in to do that
Don't have an account?

Make HTTP request from a VF Button
Hello,
I have requirement where I would like to call an apex class method which makes a HTTP callout to an external service. What is the best way to achieve this?
The HTTP service would return some data that I would like to update on the record from which the VF page button is clicked, and display alerts like initiated/completed/error.
Also, shall this method be made asynchronous or is it fine to make a synchronous request in such scenarios considering the the callback doesn't take much time.
Please help.
Thanks in advance.
I have requirement where I would like to call an apex class method which makes a HTTP callout to an external service. What is the best way to achieve this?
The HTTP service would return some data that I would like to update on the record from which the VF page button is clicked, and display alerts like initiated/completed/error.
Also, shall this method be made asynchronous or is it fine to make a synchronous request in such scenarios considering the the callback doesn't take much time.
Please help.
Thanks in advance.
In your controller:
in your javascript code;
your visualforce can invoke the action with Jquery or usign pure javascript onclick event, it depends how you feel more confortable.
Hope it helps.