<div dir="ltr">The DSL keywords are much more preferable since that allows us to play more with the internals. We assure the DSL will work, but we do not assure the internal objects will stay the same. In this specific case, I see no reason why "request->headers" won't work forever.<div><br></div><div>It seems like "headers" is only calling "header" again instead of literally calling the "headers". Vincent, would you be able to raise this as a ticket meanwhile so we could address it and you could easily track it?</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 9:44 AM, Lennart Hengstmengel <span dir="ltr"><<a href="mailto:lennart@farenji.net" target="_blank">lennart@farenji.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Vince,<br>
<br>
Try:<br>
<br>
my $headercontent = request->header('Your-Header-Here');<br>
<br>
<br>
Kind regards,<br>
Lennart<span class=""><br>
<br>
<br>
On 17-07-15 03:08, Vincent Freeman wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hi guys,<br>
<br>
I'm new to Dancer2 and I'm trying to access an authorization header, similar to Github's 'X-Hub-Signature'.<br>
<br></span>
I consulted with <a href="https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Manual.pod#header,it" rel="noreferrer" target="_blank">https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Manual.pod#header,it</a> says to use 'headers' to "Adds custom headers to responses" and 'header' to "adds a custom header to response", but it does not say how to retrieve the header information, rather than adding it.<span class=""><br>
<br>
I'm using starman with nginx as the forward proxy.<br>
<br>
This is my code for testing header access:<br>
<br>
post '//hook' => sub {<br>
         my $hd = header "Content-Type";;<br>
         "Your Headers: [".$hd."]";<br>
};<br>
  When I issue a curl, it returns empty.<br>
<br>
What am I doing wrong?<br>
<br>
Feedback welcomed and thanked in advance.<br>
<br>
Cheers,<br>
<br>
Vince.<br>
_______________________________________________<br>
dancer-users mailing list<br>
</span><a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br>
</blockquote>
<br>
_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
</blockquote></div><br></div>