How do I access NancyFX Request Header values

Viewed 6202

I need to get some custom (shibboleth) header values out the Request.Headers collection. Currently I am managing to do this using the following code:

CommonName = Request.Headers["cn"].FirstOrDefault();
Email = Request.Headers["mail"].FirstOrDefault();

Is there a less cumbersome syntax to get at the header values? I was hoping to see a dynamic object, like the Query or the Form so I could use dynamic property names, something like this:

CommonName = Request.Headers.cn;
Email = Request.Headers.mail;

Thank you.

1 Answers
Related