It's all about the answers!

Ask a question

Jazz Foundation Storage API - ETag header for updating resources

oana hategan (11235) | asked Jan 30 '13, 9:53 a.m.

I am trying to update a resource that I have already stored in a storage area using this example:

I read here
 that in order to update a resource, the entity tag (ETag) of that resource must be set as a request header.
The ETag can be obtained by sending a POST/GET/HEAD request and it can be found in the response headers, according to the documentation.
However, when I make such a request programatically, from my Java code, the ETag response header is not retrieved. When I make the same request from the RESTClient plugin, the header is retrieved.

Do you know why this happens ?

(I am using RTC 3.0.1 and I launch the plugin under Jetty server)

John Vasta commented Jan 30 '13, 5:28 p.m.

Is there any way to turn on HTTP tracing for your code? If you are using log4j, you could add

to your file. If you can get the HTTP trace, please post the request generated by your code, and the response you receive. 

2 answers

permanent link
Philippe Mulet (55112) | answered Jan 31 '13, 4:16 a.m.
There should be no special magic required to obtain the ETag response header back; it is injected always.
In standard way, the motivation for this ETag is to avoid blind concurrent updates for a given resource.

permanent link
oana hategan (11235) | answered Feb 01 '13, 6:49 a.m.
I deployed the plugin into Jazz Team Server and the ETag header is returned, no special magic required, just like you said. 
In the case when I run the plugin using the Jetty Based Server Launch, the ETag header is not returned. 
Is there maybe a specific bundle that needs to be added to this launch, in order to be able to retrieve the ETag?

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.