I have a html form in VF page with POST method.while submitting the form the data in the form elements are sent to an external system and in return I've been redirected to a new page with some response data(A html table format).I don't know how to fetch these data into my apex controller for further validation.

Any suggestions are highly appreciated.

  • Welcome to SFSE! Please make sure to include the relevant portions of your code, along with the specific issue you are struggling with and the complete text and location of any errors, in the body of your question. See How to Ask for more about our expectations, and please edit your question to add information rather than posting comments. – David Reed Dec 17 '19 at 14:09

If you're submitting the POST through the browser, your Apex can't get the return value, because the browser has left Salesforce completely. Instead, gather the form elements into your controller, and use an HttpRequest to make the POST, then you can process the response in Apex. See the Invoking Callouts Using Apex documentation for more information on making such a request.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.