title: Sending api key in Authorization header to a REST Web API
body: <p>I have a REST Web API which receives some <code>apiKey</code>. An example of a <code>GET</code> action of this Web API is:</p>
  
  <pre><code>public HttpResponseMessage Get(int id, string apiKey)
  </code></pre>
  
  <p>The only route that is defined in my Web API is:</p>
  
  <pre><code>config.Routes.MapHttpRoute(
      name: "DefaultApi",
      routeTemplate: "{controller}/{id}",
      defaults: new { id = RouteParameter.Optional }
  );
  </code></pre>
  
  <p>Now, there is a web client that uses this Web API and it sends the <code>apiKey</code> in the query string when doing <code>GET</code> requests.</p>
  
  <p>I understand that it is better to send the <code>apiKey</code> in the Authorization header of the request.</p>
  
  <p>Can someone show me how can I do a <code>GET</code> request and put that <code>apiKey</code> in the Authorization header and still land in the corect action method (I mean here the <code>Get</code> method above)?</p>