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
Finding Date range in a dao recordset
Export Project Tasks assigned to a single individual
passing random values
Changing Servers in a domain environment
Shortcut to run application with local admin privileges.
Access VBA - send email for each record in a table
Removing specific tags in dreamweaver
Using MySQL Workbench to Connect to Remote Server
SBS2008 add second mailbox for user
Exchange NDRs reports getting to the users mailboxes becasue spam