Hey, I have a solution for this, I would like to share with you.
Go to the root folder of magento first, then go to the next path
\app\code\core\Mage\Api2\Model\Request.php
Go to the getAccepTypes () method and change it using this code below, it will fulfill your requirements.
public function getAcceptTypes() { $qualityToTypes = array(); $orderedTypes = array(); foreach (preg_split('/,\s*/', $this->getHeader('Accept')) as $definition) { $typeWithQ = explode(';', $definition); $mimeType = trim(array_shift($typeWithQ)); // check MIME type validity if (!preg_match('~^([0-9a-z*+\-]+)(?:/([0-9a-z*+\-\.]+))?$~i', $mimeType)) { continue; } $quality = '1.0'; // default value for quality if ($typeWithQ) { $qAndValue = explode('=', $typeWithQ[0]); if (2 == count($qAndValue)) { $quality = $qAndValue[1]; } } $qualityToTypes[$quality][$mimeType] = true; } krsort($qualityToTypes); foreach ($qualityToTypes as $typeList) { $orderedTypes += $typeList; } unset($orderedTypes); $orderedTypes=Array ("application/json" => 1); return array_keys($orderedTypes); }
Hope this helps you.
chanz source share