0

Is there a way to export HTTP headers names into some environment variables? For example, I receive headers:

Accept: text/html 
Accept-Language: en 
User-Agent: GoogleBot

I need to have environment variable, which contains all headers names, for this example:

header_names=Accept,Accept-Language,User-Agent

Or if not possible, a set of variables each of them contain 1 header name like

header_name_1=Accept
header_name_2=Accept-Language
header_name_3=User-Agent
4
  • They are already available as environment variables. You didn't say what language or program you are looking for these variables in.
    – Aaron
    Feb 12, 2016 at 1:41
  • PHP. In PHP devs have SERVER array, however, headers names are capitalized there, while I need them not capitalized, but strictly exactly as they were sent by client.
    – Distdev
    Feb 12, 2016 at 10:55
  • Here are examples in the comments of folks setting those environment variables to other names, which certainly could be any lower case name you wish, aside from any reserved env var names.
    – Aaron
    Feb 12, 2016 at 14:48
  • No, what I need is to export HTTP headers names to ENV variable(s). By default Apache export headers with their values into SERVER array, but headers names are capitalized there, while I need to have headers in original letter case. There is no pb to get it from PHP afterwards, but I need to know how to export them from Apache.
    – Distdev
    Feb 12, 2016 at 15:46

0

You must log in to answer this question.

Browse other questions tagged .