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
Lost access to Exchange 2003 mailboxes
MySQL Three Table Join Query
Copy database wizard and have this as schedule
Norton Ghost 15.0 Licensing
Upgrading SQL Server 2008 64-bit database
"pci system error on bus device function 007ah" and others on HP NetServeer E800
Import/Export feature of SQL 2000 in SQL Express 2005
In workbench: manage connection error to local socket/pipe
Datatype mismatch error in sql code
Difference between the way a sql query is written