-1

I couldn't find simple example that sends lastmodified/Etag/Cache headers in restlet for GET requests.

Thanks

Vjy
  • 2,106
  • 3
  • 22
  • 34
  • Just ran into this myself. Found the answer [here][1]. [1]: http://stackoverflow.com/questions/9015511/setting-etag-lastmodified-on-representation-sent-by-serverresource – Andy Dennie Feb 25 '12 at 01:19

1 Answers1

0

You are probably looking for the RepresentationInfo Class and it's associated member functions that can help you do this: http://www.restlet.org/documentation/2.0/jse/api/org/restlet/representation/RepresentationInfo.html

It has 4 primary methods get/set Tag/ModificationDate

You can directly call them from the Representation class since it's a subclass of RepresentationInfo

PhD
  • 11,202
  • 14
  • 64
  • 112
  • But how do you set them within a subclass of ServerResource where the representation is still to be negotiated ? – koma Jan 25 '12 at 23:26
  • @koma - the representation IS negotiated when your method is called. A `Representation` argument is passed to your `@Get` method - that's where you'll be using this. I'm not sure what you are confused about - and boy that's a long while for the comment :) – PhD Jan 27 '12 at 22:25