Last active
August 29, 2015 14:19
-
-
Save abhirockzz/6f4c3189369d715974cf to your computer and use it in GitHub Desktop.
Extract Header information by injecting the HttpHeaders interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("testinject") | |
public class InjectURIDetails{ | |
//localhost:8080/<root-context>/testinject/httpheaders | |
@GET | |
@Path("httpheaders") | |
public void test(@Context HttpHeaders headers){ | |
System.out.println("ALL headers -- "+ headers.getRequestHeaders().toString()); | |
System.out.println("'Accept' header -- "+ headers.getHeaderString("Accept")); | |
System.out.println("'TestCookie' value -- "+ headers.getCookies().get("TestCookie").getValue()); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment