How to generate formkey in Magento and send a POST request?

by Jishnu   Last Updated October 19, 2019 16:09 PM

Magento uses some sort of form key to send POST data. I want to send POST data to a controller in Magento and receive it. How do I do that?



Answers 2


Try Mage::getSingleton('core/session')->getFormKey() to get a valid form key.

DerFrey
DerFrey
September 24, 2016 19:13 PM

I am new to Magento. Can I do this from an API? If so should I include some class or file? Can you share some sample code?

Ramanan
Ramanan
October 19, 2019 15:58 PM

Related Questions


Updated August 14, 2018 19:09 PM

Updated February 23, 2019 10:09 AM

Updated September 04, 2017 13:09 PM

Updated May 08, 2018 12:09 PM

Updated April 04, 2019 11:09 AM