zostay / RakuWAPI

The Web API for Raku (RakuWAPI)
Artistic License 2.0
24 stars 5 forks source link

Modernize HTTP_* headers #17

Open zostay opened 9 years ago

zostay commented 9 years ago

One thing I don't especially like in the environment is the way the HTTP headers are passed. This feels arcane. Maybe we keep it this way, but I'd like to also consider adding an alternative like having a hash containing the headers:

%env<p6sgi.headers> = 
    Content-Type => 'text/html',
    Content-Length => '42',
    Accept-Encoding => 'gzip',
    User-Agent => 'evilbot',
    Referer => 'https://google.com/',
;
zostay commented 9 years ago

I'm contemplating doing this for all headers, not just the HTTP_* ones. Still just contemplating it thought.