title: Get custom request header
body: <p>Im running PHP version 5.5 on WAMP. I have a very simple API. I want to get the custom request header called "api_key". First of all, I made the GET request and logged the headers like this:</p>
  
  <pre><code>        foreach (getallheaders() as $name =&gt; $value) {
              $message .= "$name: $value\n";
          }
  
          file_put_contents('headers.log', $message); 
  </code></pre>
  
  <p>This resulted in:</p>
  
  <pre><code>Host: localhost
  Connection: keep-alive
  Pragma: no-cache
  Cache-Control: no-cache
  Accept: application/json, text/javascript, */*; q=0.01
  device_id: 63843
  X-Requested-With: XMLHttpRequest
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36
  api_key: hv7Vgd4jsbb
  Referer: http://localhost/server/cli/beaufort/www/
  Accept-Encoding: gzip,deflate,sdch
  Accept-Language: en-US,en;q=0.8
  Cookie: PHPSESSID=bd3c8ce878ebc504b2128686efbe30cf;
  bd3c8ce878ebc504b2128686efbe30cf=DEFAULT%7C0%7C2M3TMlgUx3gTlaarYzHIdD28l8q9FTcNubt55%2BUGpAo%3D%7C7456bf61db3500c8bb7b3bc38082a470ce4a2ad3
  </code></pre>
  
  <p>So "api_key" is there. However, somehow, when I do:</p>
  
  <pre><code>$message = $_SERVER['HTTP_API_KEY'];
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Fatal error: Uncaught exception 'ErrorException' with message 'Undefined index: HTTP_API_KEY'
  </code></pre>
  
  <p>Why can I not get this header??</p>