title: JAXRS CXF - get http headers without specifying as method parameters
body: <p>Is it possible to retrieve http headers inside JAXRS resource method without explicitly specifying these headers as method parameters?</p>
  
  <p>For example I have a following interface:</p>
  
  <pre><code>@Path("/posts")
  public interface PostsResource {
  
    @GET
    public List&lt;Post&gt; getAllPosts();
  }
  </code></pre>
  
  <p>and the following class that implements this interface:</p>
  
  <pre><code>public class PostsResourceImpl implements PostsResource {
  
    @Autowired
    private PostsService postsService;
  
    public List&lt;Post&gt; getAllPosts() {
      return postsService.getAllPosts();
    }
  
  }
  </code></pre>
  
  <p>I don't want to change my method signature to:</p>
  
  <pre><code>public List&lt;Post&gt; getAllPosts(@HeaderParam("X-MyCustomHeader") String myCustomHeader);
  </code></pre>
  
  <p>This header will be added by interceptor on the client side so the client code doesn't know what to put here and this should not be explicit method parameter.</p>