title: Jax rs optional header param
body: <p>I am using dropwizard and jax rs to build my simple webapp. I read that all the query params specified in my method definition are optional and so are the HeaderParams. But here is where I am facing problem.</p>
  
  <p>When I skip passing any query param, still the request is routed to the appropriate method. But when I skip passing header param, my request is not even routed to that method. Kindly help.</p>
  
  <p>Example)</p>
  
  <pre><code>@GET
  @Path(/sample)
  Public Response getSample(@HeaderParam("header") final String header,
       @QueryParam("query") final String query) {
  }
  </code></pre>
  
  <p>In this sample, if I call this method with "header", this method gets invoked irrespective of whether I pass "query" param or not. At the same time, if I don't pass the "header", this method is not even getting invoked. </p>
  
  <p>Also even if I give curl -H "header:" "<a href="http://localhost/sample?query=dummy" rel="nofollow">http://localhost/sample?query=dummy</a>" the request is not getting routed. I have to necessarily give a value for my header. Kindly help.</p>
  
  <p>Note: I wrote down simplified representation of my code. Internally I am using dropwizard and swagger.</p>
  
  <p>Thanks,
  Sriram</p>