We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Access Request Headers from \Phalcon\Mvc\Micro

What's the proper why to get request header information from a Micro?

I've tried this (but its not working for me)

$app = \Phalcon\Mvc\Micro();
echo $app->getHeader('Public-Id');


I'm using curl -v -H "Public-Id: test" http://localhost/ to test


You must access the request service:

echo $app->request->getHeader('PUBLIC_ID');



Sorry, dumb mistake on that one. That was a step in the right direction, I still needed to add configuration changes to nginx.... http://serverfault.com/questions/403728/nginx-php-fpm-and-custom-header