enter image description hereI'm accessing my controller via postman tool (Postman)

I've passed custom header as shown in image and trying to access it in controller through this code:


but it returns no data. Please Help.

3 Answers 3


Finally, got the solution

$httpRequestObject = new \Zend_Controller_Request_Http();

Thank you!

  • I am using POSTMAN for rest api, How can i get my oAuth 2 details, now i have all my oAuth 1 details as well as working, now we decide to move oAuh 2, so that how can i get my oAuth 2 details? @ Manish Joy
    – zus
    Commented Oct 30, 2018 at 6:05
  • Hello, i have same requirement please share full code
    – devhs
    Commented May 19, 2021 at 10:19
  • @devhs please check the solutions given below. Its explained there.
    – Manish Joy
    Commented May 25, 2021 at 6:48

As long as your controller is a child of AbstractAction you can also access this data by request instance: $this->getRequest()->getHeader('APP_ID')

  • I'm not sure why this was initially downvoted, as this worked perfectly for me! There may be situations where $this->getRequest() isn't available, so include the class \Magento\Framework\App\RequestInterface in your constructor, as explained here: mage2.pro/t/topic/235
    – Smithee
    Commented Nov 11, 2019 at 11:29

Remember that All caps HTTP headers with underscores dropped in Apache 2.4.



So we can try add other values. For example: AppId without underscores.

We could get the header with




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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