Get HTTP header in JAX-RS
In this tutorial, we show you two ways to get HTTP request header in JAX-RS : Inject directly with @HeaderParam Pragmatically via @Context Note Refer to this wiki page for list of the HTTP header fields. 1. @HeaderParam Example In this example, it gets the browser “user-agent” from request header. import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import …