JBoss.orgCommunity Documentation

Chapter 7. @HeaderParam


RESTEasy supports @HeaderParam annotations with no parameter name..

The @HeaderParam annotation allows you to map a request HTTP header to your method invocation.

GET /books?num=5

public String getBooks(@HeaderParam("From") String from) {

Like PathParam, your parameter type can be an String, primitive, or class that has a String constructor or static valueOf() method. For example, MediaType has a valueOf() method and you could do:

public void put(@HeaderParam("Content-Type") MediaType contentType, ...)