Microsoft
Software
Hardware
Network
Question : Insert info into an HTTP header
I’m trying to add some data to the http header that comes back from a RESTful web service call. Is it possible to use JAX-RS or something else to add data to the response header?
Example of my rest method:
@GET
@Path("getAssets")
public List<Asset> getAssets(@QueryParam("pag
e") @DefaultValue("1") String page,
@QueryParam("page_size") @DefaultValue(UNLIMITED) String pageSize) throws Exception
{
stuff…
}
Thanks for your help.
Answer : Insert info into an HTTP header
For anybody interested in how I solved my problem
. I used the javax.ws.rs.core.Context annotation.
@Context
HttpServletResponse response;
Then in my service methods I added this:
response.addHeader("n
ame", "value");
That is it.
Random Solutions
Installing the SBS 2008 server (off location) prompts for migration if installing in existing domain...
Excel 2007 Macro Environ("UserName") Causing Error
How to take a screenshot using VBS
Windows server 2003
how to install cystal reports version 7 in windows 7
How Do I retrieve information from a website contact form
What to insert into PHP form to help prevent hacking
Disabling or Expirying Browser's Back button
breaking down Excel cell
IDS/IPS VM on Laptop (Protecting Host)