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)

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


4.2k

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



84.5k

You must access the request service:

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

http://docs.phalconphp.com/en/latest/api/Phalcon%5Http%5Request.html



4.2k
Accepted
answer

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