I have a task to create products programmatically using the JSON data.
I created a new module to make a custom controller. Then I hit the url using the http requester add on through Mozilla browser, and submitted the JSON data by POST method. But it does not fetch the submitted data.
If I am able to submit the JSON data through http requester to my controller, then I will be able to create the products using the same.
My controller code is updated here
<?php
class Probytes_Productcreate_IndexController extends Mage_Core_Controller_Front_Action {
public function indexAction() {
$this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true);
$this->getResponse()->setBody(json_encode($response));
$params = $this->getRequest()->getPost('test');
echo $params;
//die();
}
}
?>
Is there any solution to sumbit a JSON data to the custom controller in magento. I am using magento version 1.9. Any help would be appreciated. Thanks in advance.